Hello,
Im using JMail.Message v4.5 to send out batch emails (20 recipients per email) to a list of members (its a newsletter).
The function generates a list of member emails from a database, it then loops through each address adding it to the BCC field. Once the BCC field contains 20 recipients the email is sent and the recipient list is cleared ready for the next 20. This repeats until all members have been emailed.
The function works fine when all email addresses are valid, however should it come across an invalid email (maybe the member has switched ISPs, etc) the function fails and no emails are sent.
Im coding in VBScript on a shared windows hosting account. The code Im using is shown below, please note I have changed the name of the domain, email accounts and passwords for obvious reasons, as well as simplified the [loop] and [if] constructs:
Note: I've also tried removing the following and it still fails:Code:Dim objJMail Set objJMail = Server.CreateObject("JMail.Message") objJMail.Logging = True objJMail.Silent = True objJMail.From = "me@mydomain.com" objJMail.FromName = "Me at My Website" objJMail.MailServerUserName = "admin@mydomain.com" objJMail.MailServerPassword = "dummy_password" objJMail.Priority = 3 objJMail.Subject = "Subject Title" objJMail.Body = "Message Body" [loop through email addresses] objJmail.AddRecipientBCC [recipient_email_address] [if 20 recipients - send email, clear recipient list] blSuccess = objJMail.Send("mail.mydomain.com") objJMail.ClearRecipients() [end if] [end loop] ' Finished looping through recipients - send final email blSuccess = objJMail.Send("mail.mydomain.com") ' Tidy Up JMail object objJMail.Close Set objJMail = Nothing
The error information for this is below:Code:objJMail.MailServerUserName = "admin@mydomain.com" objJMail.MailServerPassword = "dummy_password"
Code:JMail ErrorCode: 554 JMail ErrorMessage: The message was undeliverable. All servers failed to receive the message
I've tried the function with a sample list containing 2 email addresses, one is invalid (batman@mydomain.com) and the other is fine (legit@mydomain.com). The JMail Log shows the following:
Anyone have any ideas?Code:The message was undeliverable. All servers failed to receive the message .execute() { Trying server mail:mail.mydomain.com <- 220 xmail02.myhosting.com ESMTP 648143d3667b3045487bb901cdbbf649 -> EHLO web3002.ad1.softcom.biz <- 250-xmail02.myhosting.com 250-PIPELINING 250-SIZE 100000000 250-DATAZ 250-AUTH LOGIN PLAIN 250 8BITMIME -> AUTH LOGIN Sending authentication data..-> MAIL FROM: <- 250 ok -> RCPT TO:batman@mydomain.com <- 554 Sorry, no mailbox here by that name. (#5.1.1) -> RCPT TO:legit@mydomain.com Error: Connection reset by client. .execute() { Trying server mail:mail.mydomain.com <- 220 xmail02.myhosting.com ESMTP 648143d3667b3045487bb901cdbbf649 -> EHLO web3002.ad1.softcom.biz <- 250-xmail02.myhosting.com 250-PIPELINING 250-SIZE 100000000 250-DATAZ 250-AUTH LOGIN PLAIN 250 8BITMIME -> AUTH LOGIN Sending authentication data.. -> MAIL FROM: <- 250 ok -> RCPT TO:batman@mydomain.com <- 554 Sorry, no mailbox here by that name. (#5.1.1) -> RCPT TO:legit@mydomain.com Error: Connection reset by client. 1 of 1 servers failed } }
What I want it to do is ignore any invalid emails and continue. For some reason, after the invalid email attempt is aborted, when it tries to send to the legit recipient that is next in the list, it fails as the connection is reset.
Cheers
Simon




Reply With Quote
ops: 

