/    Sign up×
Community /Pin to ProfileBookmark

argosoft mail bug

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

[/code]

the problem is with this bit:

[code=php]From: $name <{$addr}>[/code]

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]>[/code]

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
[/code]

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][/code]

so i’m a bit stumpted really..

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@bokehAug 15.2006 — Nothing to do with the mailexchanger. One of the variables contains a CRLF.
Copy linkTweet thisAlerts:
@aerodudeauthorAug 16.2006 — Yes, you're right! What an idiot i am!

Thank you so much!
×

Success!

Help @aerodude spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...