I’m using the argosoft mail client and I’m finding a really odd bug..
I have my function like so:
[code=php]
function send($content,$to,$name=EMAIL_FROM_NAME,$addr=EMAIL_FROM_ADDR){
if(is_array($to)) $to=implode(‘, ‘,$to);
$headers=”From: $name <{$addr}>rnX-Mailer: PHP/”.phpversion();;
$subject=”This is the subject”;
$body=”<html><body><strong>This is the body</strong></body></html>”;
echo $headers;
return @mail($to,$subject,$body,$headers);
}
the problem is with this bit:
[code=php]From: $name <{$addr}>
For some reason argosoft splits the from at the first whitespace, so if the details were like this:
[code=php]From: My Name <[email protected]>
Then it tries to send the email from “<My>” and obviously that doesnt work, heres the error message for clarity:
[code]
8/15/2006 2:46:50 PM – [ 29] MAIL FROM:<My>
8/15/2006 2:46:50 PM – [ 29] 501 <My>: sender address must contain a domain
8/15/2006 2:46:50 PM – [ 29] QUIT
Anyone experienced this problem or know of any ways to stop it?
By the way it works if just the email is specified i.e.
[code=php]From: [email protected]
so i’m a bit stumpted really..