inVINCEable Posted February 11, 2008 Share Posted February 11, 2008 I have set up the mail function correctly, and have tried SEVERAL smtp servers only to keep getting a 550 error, invalid recipient. I have read that it has something to do with the from headers, as I have tried setting up in the function itself, and using ini_set('smtpmail_from', $from_header) Does anyone have any advice? Thank you. Link to comment https://forums.phpfreaks.com/topic/90446-550-error-when-using-mail-invalid-recipient/ Share on other sites More sharing options...
Northern Flame Posted February 11, 2008 Share Posted February 11, 2008 can you post your code? Link to comment https://forums.phpfreaks.com/topic/90446-550-error-when-using-mail-invalid-recipient/#findComment-463689 Share on other sites More sharing options...
inVINCEable Posted February 12, 2008 Author Share Posted February 12, 2008 function mailpassword(){ ini_set("sendmail_from", "[email protected]"); echo "hello"; $persons_to_email = $this->Reset->findAll(); foreach ($persons_to_email as $person){ $email_address = $person['Reset']['email']; $reset_code = $person['Reset']['reset_code']; e $message = "Please visit the link below to reset your password..."; $message .= "http://localhost/users/newpassword/$reset_code"; if(mail($email_address, "Password reset to NzbNation", $message)) { $id_to_delete = $person['Reset']['id']; $this->Reset->delete($id_to_delete); } } } Sorry... here it is. Link to comment https://forums.phpfreaks.com/topic/90446-550-error-when-using-mail-invalid-recipient/#findComment-464440 Share on other sites More sharing options...
affordit Posted February 12, 2008 Share Posted February 12, 2008 function mailpassword(){ ini_set("sendmail_from", "[email protected]"); echo "hello"; $persons_to_email = $this->Reset->findAll(); foreach ($persons_to_email as $person){ $email_address = $person['Reset']['email']; $reset_code = $person['Reset']['reset_code']; e <----- Whats this for? $message = "Please visit the link below to reset your password..."; $message .= "http://localhost/users/newpassword/$reset_code"; if(mail($email_address, "Password reset to NzbNation", $message)) { $id_to_delete = $person['Reset']['id']; $this->Reset->delete($id_to_delete); } } } Link to comment https://forums.phpfreaks.com/topic/90446-550-error-when-using-mail-invalid-recipient/#findComment-464448 Share on other sites More sharing options...
inVINCEable Posted February 12, 2008 Author Share Posted February 12, 2008 function mailpassword(){ ini_set("sendmail_from", "[email protected]"); echo "hello"; $persons_to_email = $this->Reset->findAll(); foreach ($persons_to_email as $person){ $email_address = $person['Reset']['email']; $reset_code = $person['Reset']['reset_code']; e <----- Whats this for? $message = "Please visit the link below to reset your password..."; $message .= "http://localhost/users/newpassword/$reset_code"; if(mail($email_address, "Password reset to NzbNation", $message)) { $id_to_delete = $person['Reset']['id']; $this->Reset->delete($id_to_delete); } } } It is added onto the URL that is sent in the message. Look at the 2nd line after that. $message .= "http://localhost/users/newpassword/$reset_code"; Link to comment https://forums.phpfreaks.com/topic/90446-550-error-when-using-mail-invalid-recipient/#findComment-464470 Share on other sites More sharing options...
inVINCEable Posted February 13, 2008 Author Share Posted February 13, 2008 Anyone...? Link to comment https://forums.phpfreaks.com/topic/90446-550-error-when-using-mail-invalid-recipient/#findComment-465417 Share on other sites More sharing options...
inVINCEable Posted February 14, 2008 Author Share Posted February 14, 2008 Bump again? Sorry folks I'm getting desperate. ??? Link to comment https://forums.phpfreaks.com/topic/90446-550-error-when-using-mail-invalid-recipient/#findComment-466419 Share on other sites More sharing options...
haku Posted February 14, 2008 Share Posted February 14, 2008 try echoing $email_address and seeing what it says. It looks like that's where your problem lies - the recipients email address is incorrect. Link to comment https://forums.phpfreaks.com/topic/90446-550-error-when-using-mail-invalid-recipient/#findComment-466501 Share on other sites More sharing options...
inVINCEable Posted February 15, 2008 Author Share Posted February 15, 2008 try echoing $email_address and seeing what it says. It looks like that's where your problem lies - the recipients email address is incorrect. I did and it echoed the email address properly. I have even tried several extensions, using gmail, hotmail, and netscape. Link to comment https://forums.phpfreaks.com/topic/90446-550-error-when-using-mail-invalid-recipient/#findComment-467305 Share on other sites More sharing options...
haku Posted February 15, 2008 Share Posted February 15, 2008 That's an interesting one. If the email address is echoing out the correct address before the function, then it should be going through, as your mail function looks to be formed properly. Maybe you could take a different direction and try using a mailing class. I use phpmailer myself - its quite easy to use and works well. There is a decent tutorial on the site that explains how to use it as well. Unfortunately however, this doesn't really solve your problem, rather it just works around it. I prefer to solve problems, so my reply here isn't very good. I do have one question though - you said you are getting the 550 error. Where are you seeing this error? Link to comment https://forums.phpfreaks.com/topic/90446-550-error-when-using-mail-invalid-recipient/#findComment-467321 Share on other sites More sharing options...
inVINCEable Posted February 17, 2008 Author Share Posted February 17, 2008 I am seeing this error in the CMD window. I am running this as a CRON job. I will attempt to use a mailing class in a few hours or tomorrow hopefully. But I am very much like you and like to solve my problems as it makes me feel more at ease. Link to comment https://forums.phpfreaks.com/topic/90446-550-error-when-using-mail-invalid-recipient/#findComment-469115 Share on other sites More sharing options...
haku Posted February 26, 2008 Share Posted February 26, 2008 Why don't you run the script through your browser and get it running before executing it as a cronjob. Once you have it going smoothly, then you set up the cronjob. Link to comment https://forums.phpfreaks.com/topic/90446-550-error-when-using-mail-invalid-recipient/#findComment-476979 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.