This topic is locked
[SOLVED]

 Send email requires SMTP.. but not with forgot password

5/25/2010 12:08:03 PM
PHPRunner General questions
F
FunkDaddy author

I am getting an error message when I try to send email from PHPRunner as follows: "mail() [function.mail]: SMTP server response: 501 Syntax error in parameters or arguments"
I looked through the forums and apparently I need to change the mail function to use something such as PHPMailer... I'm looking into that now... However, what I don't understand is why the "Forgot Password" feature that is built-in to PHPRunner is able to send out emails (works perfectly) but not in any other scenario. Wouldn't this indicate that the web server I am using is in fact accepting/sending unauthenticated SMTP email??? I tried looking at the remind.php page generated by PHPRunner to see if I could figure out what you guys did that makes this work... could you provide me with the code? Or any insight as to what I should do?
I'll start looking into the PHPMailer option, but it seems to me that you already have this issue figured out (as evidenced by the forgot password feature being able to send emails)... so I'd rather use a built-in solution than having to add an outside class (PHPMailer).
Thanks, and I look forward to your insights.
Best,
Marcelo Ramagem

F
FunkDaddy author 5/25/2010

As Sergey kindly pointed out to me...
"According to error message something is wrong with one of email parameters. I don't think it has anything to do with SMTP authentication."
And upon inspection I noticed that a very simple mistake in this part of my mail code:



$email=$data["Parent1_Email"].", " .$data["Parent2_Email"].", " ;
$from=$data["Email_From"];
$msg=$data["Letter_Body"];


The error was that I had a space after the comma that separates more than one email address. The problem was fixed by simply removing the space after each comma. Now the server sends email whether with one or two emails in the to address!
YAY!
M