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
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);

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.