Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:"
Old 11-19-2010, 06:31 AM Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:"
Novice Talker

Posts: 8
Name: Danish
Trades: 0
Hi,

I am sending a simple email through mail() function in php.........But it flagging up with the error given below:

PHP Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\HostingSpaces\myweb\mywebsite.com\wwwroot\contr oller\contact.controller.php on line 73

Pleasae find the more details as how I am doing this:

PHP Code:
$msg $_POST['info'];
  
$em $_POST['email'];
  
$nm $_POST['name'];
  
$ph $_POST['phone'];
  
$cont $_POST['country'];
  
$st_addy $_POST['streetaddress'];
  
$city $_POST['city'];
  
$zip $_POST['pin'];
  
$com $_POST['company'];
  
$abt $_POST['product'];
  
$from "Customer Care <admin@mywebsite.com>";
  
$to "Admin <myname@gmail.com>";
  
$subject "Hi!";
  
$message "Dear Admin,
  
  A customer "
.$nm.", has asked a quote, detials are:
  Email: "
.$em."
  Phone: "
.$ph."
  Country: "
.$cont."
  City: "
.$city."
  Zip: "
.$zip."
  Address: "
.$st_addy."
  Product Id: "
.$abt."
  
  Message
  
  "
.$msg;
 
$headers  'MIME-Version: 1.0' "\r\n" 'Content-type: text/html; charset=iso-8859-1' "\r\n";
 
 
mail($to$subject$message$headers$from);
 die; 
Danish_55 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-19-2010, 08:01 AM Re: Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "Fr
hhunt's Avatar
Average Talker

Posts: 15
Name: Helen
Trades: 0
Have you configured your email server in the php.ini file? If not, you should go there first and make sure you have that configured before trying to send again.

Secondly, it looks like you were trying to send email from your local computer - make sure you have a webserver installed and running on that computer

Good luck
__________________
A top-class
Please login or register to view this content. Registration is FREE
that won't rifle through your photos Honest
Please login or register to view this content. Registration is FREE
lesson
Cheap
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
hhunt is offline
Reply With Quote
View Public Profile Visit hhunt's homepage!
 
Old 11-19-2010, 12:15 PM Re: Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "Fr
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
You have to include from in the headers, not the additional parameters.
PHP Code:
$headers  "From: $from \r\n" 'MIME-Version: 1.0' "\r\n" 'Content-type: text/html; charset=iso-8859-1' "\r\n";

mail($to$subject$message$headers); 
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 11-20-2010, 05:09 AM Re: Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "Fr
Novice Talker

Posts: 8
Name: Danish
Trades: 0
Thanks.........Now it flagging up with this error:

PHP Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 26, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\HostingSpaces\me\mywebsite.com\wwwroot\controll er\contact.controller.php on line 73

Any help would be appreciated.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by Danish_55; 11-20-2010 at 05:12 AM..
Danish_55 is offline
Reply With Quote
View Public Profile
 
Old 11-22-2010, 04:13 AM Re: Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "Fr
Banned

Posts: 408
Name: mushget
Trades: 0
change the php.ini file in the system32 dir
mushget is offline
Reply With Quote
View Public Profile Visit mushget's homepage!
 
Reply     « Reply to Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:"
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15156 seconds with 12 queries