Jump to content

problems with sending mail


garydt

Recommended Posts

The error i'm getting is

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Program Files\xampp\htdocs\epeople\editphoto.php on line 194

 

 $big = $row_Recordset2['bigimagename'];
$username = $row_Recordset4['usernm'];
$from = 'test@uk.com';
$to = 'gary@garyt.co.uk';
mail($to,$from,$big,$username);

 

the settings in php.ini are

 
[mail function]
; For Win32 only.
;SMTP = smtp.tiscali.co.uk
;smtp_port = 25

; For Win32 only.
sendmail_from = me@localhost.com
sendmail_path = C:\Program Files\xampp\sendmail
pop3_server= pop.tiscali.co.uk
pop3_username= garydt88
pop3_password= garytanner

What have i got wrong?

Link to comment
https://forums.phpfreaks.com/topic/56352-problems-with-sending-mail/
Share on other sites

Try switching your "mail" order around.

 

mail("john@example.com", "An HTML Message", $body, $from);

 

Or adding headers:

 

$headers = "From: info@example.com \r\n"; 
$headers.= "Content-Type: text/html; charset=ISO-8859-1 "; 
$headers .= "MIME-Version: 1.0 "; 

mail("john@example.com", "An HTML Message", $body, $headers);

Thanks.

I tried-

// send emmail
$big = $row_Recordset2['bigimagename'];
$username = $row_Recordset4['usernm'];
$from = 'test@uk.com';
$to = 'gary@garyt.co.uk';
$body = "test";

$headers = "From: info@example.com \r\n"; 
$headers.= "Content-Type: text/html; charset=ISO-8859-1 "; 
$headers .= "MIME-Version: 1.0 "; 

mail("gary@garyt.co.uk", "An HTML Message", $body, $headers);

And i got error-

Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for gary@garyt.co.uk in C:\Program Files\xampp\htdocs\epeople\editphoto.php on line 200

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.