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. Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted February 11, 2008 Share Posted February 11, 2008 can you post your code? Quote Link to comment Share on other sites More sharing options...
inVINCEable Posted February 12, 2008 Author Share Posted February 12, 2008 function mailpassword(){ ini_set("sendmail_from", "support@localhost.com"); 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. Quote Link to comment Share on other sites More sharing options...
affordit Posted February 12, 2008 Share Posted February 12, 2008 function mailpassword(){ ini_set("sendmail_from", "support@localhost.com"); 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); } } } Quote Link to comment Share on other sites More sharing options...
inVINCEable Posted February 12, 2008 Author Share Posted February 12, 2008 function mailpassword(){ ini_set("sendmail_from", "support@localhost.com"); 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"; Quote Link to comment Share on other sites More sharing options...
inVINCEable Posted February 13, 2008 Author Share Posted February 13, 2008 Anyone...? Quote Link to comment 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. ??? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.