|
Posted by Martin Jay on 05/11/06 12:01
In message <Ev6dncTFUcQEZfzZRVn-ug@comcast.com>, Joe Joe
<spamblocker@excite.com> writes
>Here's more of the code still not working. I am using Outlook 2003 set to
>read html and plain text. Email is formatted as plain text. I have a .com
>and .net Email address, same host, same server for both accounts, same Email
>client, same settings, they go to same inbox, both Netsol domains??? The
>.net is blank the .com is perfect.
>
><? error_reporting(0); ?>
><?php
>include 'connectiondata.php';
>
>
>function sendemail($from, $email, $title, $emailmessage)
>{
>/*
>$subject = "".$title;
>$message = ' <html> <head> <title></title> </head>
><body>'.$emailmessage.'</body></html> ';
>$headers = "MIME-Version: 1.0\r\n";
>$headers .= "Content-type: text/html;
>charset=iso-8859-1\r\n";
>$headers .= "To: <".$email.">\r\n";
>$headers .= "From: ".$from.">\r\n";
There's a small error above, it should be:
$headers .= "From: <".$from.">\r\n";
Perhaps the '<' character go lost during cut'n'paste.
>mail($to, $subject, $message, $headers);
Shouldn't that be:
mail($from, $subject, $message, $headers);
>echo $from.' '.$email,' '.$title.' '.$message;
>*/
>
>$msg = $emailmessage;
>
>$recipient = $email;
>
>$subject = $title;
>
>$mailheaders = "From: webmaster@customersite.net\n";
Should be:
$mailheaders = "From: webmaster@customersite.net\r\n";
>$mailheaders .= "Content-type: text; charset=iso-8859-1\r\n";
>$mailheaders .= "Reply-To:". $email."\n\n";
It's probably a good idea to put '<' and '>' around the email address
and leave a space after 'Reply-To:' and put '\r\n' at the end of the
line:
$mailheaders .= "Reply-To: <". $email.">\r\n";
>$mailheader.="MIME-Version: 1.0\r\n";
>
>mail($recipient, $subject, $msg, $mailheaders);
>
>}
With the errors above still in place the script wouldn't send any email
from my machine. Perhaps they have caused some headers to become
mangled, and it's just a fluke that email reaches .com addresses.
If that doesn't help I don't know what else to suggest. After making
those changes I've successfully used the script to email my .net and
..org.uk email addresses.
--
Martin Jay
Navigation:
[Reply to this message]
|