View Full Version : Recipient address rejected - Script stops
steen120697
09-24-2009, 01:37 AM
We are using the CDONTS NewMail object to send out a number of emails taken from a recordset.
Somewhere down list (no. 127) the inevitable happens: wrong email address. We get this message:
Recipient address rejected: Domain not found; from=<mail@ourdomain.com> to=<mail@theirdomain.com>
The script stops and we get an internal http 500 server error. According to our log, the system did send out 127 emails before it stopped.
Please tell me what I am doing wrong?
Jason Byrnes
09-24-2009, 09:19 AM
One of the addresses in your database is not a valid email address. check the email addresses in your recordset.
Maybe create a repeating region to write them to the web page so you can examine them.
Office Guy-172461
09-24-2009, 09:54 AM
I think what he's asking is how to prevent a total stop to the process when it hits a bad address. You can't always prevent users from entering a bad address.
steen120697
09-24-2009, 10:18 AM
The process stops totally and that's my problem - thank you office172461. My list probably contains numerious bad addresses and I have no way of checking this.
So my question is: How can I make sure that the process continues and gets to the end of my list even with a few a bad addresses here and there?
Lon Winters
09-24-2009, 10:51 AM
By not being a "valid" email address, I think he means that it has to do with formatting, not that the email address actually exists.
A properly formatted email address will still send, it will just bounce back if the recipient doesn't exist. The only time I ever ran into this problem, that was the cause - there was a space or a dot where it wasn't supposed to be.
As far as user entry, it's necessary to have form validation on email addy input fields - if it passes validation for an email address field, then it will work with UE.
steen120697
09-24-2009, 11:14 AM
My hope lasted only shortly. I just checked the address that caused the process to stop and it IS a valid address.
Jason Byrnes
09-25-2009, 03:53 PM
Is there a leading or trailing space on the address?
try using the trim function to remove any leading pr trailing spacess:
$RecipientEmail = "".trim($row_RSName["Email"]) ."";include("WA_Universal_Email/WAUE_users_EmailPW_1.php");
steen120697
09-28-2009, 01:02 AM
The address looks really allright to me but it seems like a good idea to use the TRIM function in any case.
Would you care to send me the correct function in ASP?
Thanks
Jason Byrnes
09-28-2009, 03:01 PM
In asp, the recipient email is added as:
WA_Universal_Email_1_SendMail("" & cStr(cStr(Request.Form("textfield"))) & "")
to use the Trim function;
WA_Universal_Email_1_SendMail("" & cStr(cStr(Trim(Request.Form("textfield")))) & "")
steen120697
09-29-2009, 04:18 AM
I tried the TRIM function and my script still stops completely when I get to one particular address.
I checked the email address using this link http://www.rolosoft.com/software/email-check/wa/lite/validate.aspx. Don't know if this validator makes any sense but I get "Mail box does not exist".
The address giving me all this headache is ocn@thtane.com
Jason Byrnes
09-29-2009, 11:15 AM
The domain:
thtane.com
does not exist.
An internic whois lockup for that domain does not yeild a result:
http://reports.internic.net/cgi/whois?whois_nic=thtane.com&type=domain
and if you go to Godaddy.com and try to register that domain, it is available.
The SMTP server most likely has The "reject_unknown_recipient_domain" restriction in place which is causing the error. This will need to be turned off on the SMTP server to allow the script to complete, or the bad email address will need to be removed.
steen120697
10-02-2009, 03:10 AM
The SMTP server does have the "reject_unknown_recipient_domain" restriction in place so that's most likely where my problem is. The SMTP server host will NOT turn off this function so I am not making much progress.
Deleting the address is of course a solution but in my opinion not a very smooth one.
Is there any chance you guys developed some code that handles whatever message comes from the SMTP server to make the script continue?
Jason Byrnes
10-05-2009, 02:32 PM
try changing:
WA_Universal_Email_1_SendMail("" & cStr(cStr(Trim(Request.Form("textfield")))) & "")
to:
On Error Resume Next
WA_Universal_Email_1_SendMail("" & cStr(cStr(Trim(Request.Form("textfield")))) & "")
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.