qwave Posted June 9, 2006 Share Posted June 9, 2006 I have a form on my website where the user registers his account, including email address. Once he submits the form, PHP executes the mail() function to send a confirmation email. However, if the user inputted an invalid address, the error message appears at the top of the page: "Warning: mail(): SMTP server response: 550 Invalid recipient: blahblah@fdshjfs.com in...."I dont want the user to see this error message. I want to return a different error message and post it somewhere else on the page, such as "Invalid email address.". How can I make it so that mail() does not echo the error message to the immediete frame? Quote Link to comment https://forums.phpfreaks.com/topic/11606-disabling-php-mail-invalid-recipient-error/ Share on other sites More sharing options...
qwave Posted June 10, 2006 Author Share Posted June 10, 2006 Does anyone know the answer to this? =/ Quote Link to comment https://forums.phpfreaks.com/topic/11606-disabling-php-mail-invalid-recipient-error/#findComment-44127 Share on other sites More sharing options...
poirot Posted June 10, 2006 Share Posted June 10, 2006 You can use error supression:[code]if (!@mail(...)) { echo 'Mail not sent';} else { echo 'Success';}[/code] Quote Link to comment https://forums.phpfreaks.com/topic/11606-disabling-php-mail-invalid-recipient-error/#findComment-44129 Share on other sites More sharing options...
qwave Posted June 10, 2006 Author Share Posted June 10, 2006 Brilliant! Worked like a charm, thanks so much. Quote Link to comment https://forums.phpfreaks.com/topic/11606-disabling-php-mail-invalid-recipient-error/#findComment-44133 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.