Hi,
Have got the simple mail class working and its great.
I am just having a problem with the "From" part of the email, this is overwritten by the server php.ini file (IIS and Win2K), all the emails come from the admin rather than the email address passed into the class.
I have tested with a simple (not MIME) email and the from field works so it must have something to do with my code.
Here is my code calling the simple mail class, and doesnt set correct From field, I use the simple mail class and havent changed the downloaded code.
function SendMail($strTo, $StrFrom, $StrFromName, $StrSubject, $htmlContent, $txtContent) {
$postcard = new SimpleMail();
$postcard->to = $strTo;
$postcard->from = $StrFrom;
$postcard->cc = "tim@type3.co.uk";
//$postcard->bcc = "bccaddress@yourhost.com";
$postcard->subject = $StrSubject;
$postcard->body = $txtContent;
$postcard->htmlbody = $htmlContent;
$postcard->send_html = TRUE;
if ($postcard->send()) {
//echo "Multipart email sent successfully!";
}
}
and this is the test send mail that works setting the correct from field
$to = "tim@type3.co.uk";
$subject = "ZDNet Developer article";
$msg = "I completely understand SMTP servers now!";
$headers = "From:
me@mycompany.com\r\nReply-To:
someoneelse@mycompany.com";
mail("$to", "$subject", "$msg", "$headers");
echo "finished!";
Any help muchly appreciated.
Tim