Greetings,
I've set up a mailer for a client of mine to send out email from addresses in their domain.
I'm using, among other things, the following code, where $to, $from, $subject and $body are passed to the script from the mailing form:
----Begin Code----
if($mailinglist=="N")
{
$mailto=$to;
print "Sending Mail To: ";
print $mailto;
$sentby=$from;
$sentby .= "@manhattanmambo.co.uk";
$body=stripslashes($body);
$subject=stripslashes($subject);
$extras="From:$sentby\nReturn-Path:failures@manhattanmambo.co.uk\nBcc:manhattanmambo@hotmail.com richardw@doctordeck.clara.net $mailto";
$diditgo=mail($mailto,$subject,$body,$extras);
if($diditgo==true)
{print " ---- Sent.<BR>";
}
else
{print " ---- Failed. <BR>";
}
----End Code----
If I use this to send mail to, for example, a hotmail account, it works fine, but if I do it to my work email, it does not. Likewise, it did not work for sending mail to any of the addresses in the manhattanmambo.co.uk domain, whose emails are forwarded onto a yahoo email address. It works to send to my home clara.net email, and my another.com ricardo@missionimpossible.co.uk email address, although it only started doing this when I added the $mailto variable into the BCC field in $extras. I'm completely stumped. Does anyone have any ideas why this command is working for some addresses but not others? I know every email is sent because I get BCC'd on them, and my clara.net email picks up every single one.
Could it be something to do with the individual settings of different domain's email rejecting messages that have been sent from this kind of interface? I just don't know any more.
Help!
Kind regards
Richard