Jump to content

Mail wont send with name and email


dannyoneill

Recommended Posts

Hi, My mail scripts used to work fine until I upgraded to PHP 5.2.6.

 

Since then if I send a mail with anything other than the email address in the To: or From: it fails i.e To: Joe Bloggs <[email protected]>

 

I think its because of this emails from workpress fail as the code seems to include a name and email. I have the problem on my live dedicated server as well as a freshly built server. Wordpress just doesnt send and said mail() isnt allowed if I try a password reset and my php script fails with a syntax error (the syntax is 100% correct and worked before). But remove the name so the to reads To: [email protected] and its all fine.

 

The details are below

 

Windows Server 2003

PHP 5.2.6

Mail extensions included

Windows SMTP server, localhost

 

Link to comment
https://forums.phpfreaks.com/topic/109871-mail-wont-send-with-name-and-email/
Share on other sites

oddly enough, I've noticed the same thing.  Luckily, I run my own server, and manage my own MTA, so I got to see what the issue is.  It spits out an error code ("Invalid e-mail address") if you use something like

Joe Smith<[email protected]>

the mail function now wraps the from in this: <>, so when you add it the way we want to, your MTA receives this:

From: <Joe Smith<[email protected]>>

as you can see, that's not a real e-mail address.  Hopefully they will release a patch in the next week or so for this.

Several of the "new" bugs in php seem to be occurring because of a lack of knowledge by the person(s) making the change. Someone apparently decided to have the code "magically" add < > around email addresses even though that syntax is only used when there is an alias name in front of the email address.

 

All of the "magical" things that php attempted to do in the past for the programmer, that he should have been doing himself, and only when he wanted them to be done, simply introduced problems that then had to be removed later.

 

If you have not submitted a php bug report, find if there is an existing one and add your observations to it (the more people that report the same bug, the quicker it gets fixed) or create a new bug report.

Several of the "new" bugs in php seem to be occurring because of a lack of knowledge by the person(s) making the change. Someone apparently decided to have the code "magically" add < > around email addresses even though that syntax is only used when there is an alias name in front of the email address.

 

All of the "magical" things that php attempted to do in the past for the programmer, that he should have been doing himself, and only when he wanted them to be done, simply introduced problems that then had to be removed later.

 

If you have not submitted a php bug report, find if there is an existing one and add your observations to it (the more people that report the same bug, the quicker it gets fixed) or create a new bug report.

great observations.  For now, my solution was to step back a release in php.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.