Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Intermittent email problems

Status
Not open for further replies.

gmmastros

Programmer
Feb 15, 2005
14,901
US
My application allows users to send emails. Before anyone thinks it's a spamming application, it's not. This email functionality allows transportation directors to notify students about delays with their school bus routes. Because of this, there are times when many emails get sent simultaneously.

Basically, the code is this:

Code:
    Set objCDOSysMail = CreateObject("CDO.Message")
    Set objCDOSysCon = CreateObject("CDO.Configuration")
    
    With objCDOSysCon
        .Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver")[/URL] = oEmail.Configuration.SMTPServer
        .Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")[/URL] = oEmail.Configuration.RequiresAuthentication
        .Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/enablessl")[/URL] = oEmail.Configuration.UseSSL
        .Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusername")[/URL] = oEmail.Configuration.Username
        .Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendpassword")[/URL] = oEmail.Configuration.Password
        
        .Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserverport")[/URL] = oEmail.Configuration.Port
        .Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing")[/URL] = 2
        .Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpusessl")[/URL] = oEmail.Configuration.UseSSL
        .Fields("[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")[/URL] = 10
        .Fields.Update
    End With
    
    Set objCDOSysMail.Configuration = objCDOSysCon

    With objCDOSysMail
    
		.From = oEmail.Configuration.From
		.To = Addresses(i)
		.Subject = oEmail.Subject
		'.BCC = Cc
		
		.HTMLBody = oEmail.Text
		
		.Fields.Update
		
		.Send
            
    End With
    
    Set objCDOSysMail = Nothing
    Set objCDOSysCon = Nothing

Originally, email was configured to use my customers email server. When configured this way, the customer would occasionally get errors, such as:

[tt]Unable to send email. The server rejected one or more recipient addresses. The server response was: 501 5.1.3 Invalid address

or

The transport failed to connect to the server
[/tt]

According to the customer repeated attempts to send the email allows it to work.

I explained to the customer that the problem is probably caused by their email server and that there's nothing I can do to help resolve the problem. They insisted that the problem is mine and that I need to fix it.

I then suggested that they get a free gmail account and use that for their emails. They did this and all was well until today when they got an error regarding sending limits.

Finally, my question:

Using this method, is there a way to test connectivity to the mail server without actually sending an email?

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
The email system in total is never 100% guaranteed.
Haven't you ever had someone say to you "didn't you get my email I sent you?"
Maybe you need some sort of confirmation of reception. This shouldn't be too hard with reporting to you only of emails that don't get read and replied to within a reasonable time then send again?
Can you include a "please confirm you have received it" thing so you know whether they got it?

What gmail limit would you be exceeding?
I believe you can increase the gmail limits using the Google Drive thingy but not sure how to with code.
Maybe you have to clear a record of old sent emails every week?

To test, open up a new different yahoo mail account in your computer and send a whole lot of emails to yourself to test.(spam yourself)

I use Yahoo mail to send without any problems and use EaSendmailobj.dll with minimum code.
There doesn't seem to be any limit on incoming Yahoo email. One very old Yahoo.com account I opened 10 years ago and discarded is still functioning with over 100000 spam emails still there unread. I can't find any reasonable way of clearing them other than 25 at a time!
 
Google limits free email accounts to 500 sent emails per day. There is no practical limit to the number of incoming emails (other than the 15 or so GB of storage space you are allowed).

The problem here is that there can be up to 3 emails per bus rider (2 parents and the child themselves). So, each bus could easily generate 150 emails. Sending emails to more than a small handful of buses and you're suddenly at your 500 email limit.

I suppose what I'm really looking for is a way to show the customer that the email problem is really with their mail server and not with the way that I am sending emails.

Of course, I am open to the suggestion that the way I am sending emails is the problem, which is why I posted the code that I am using.


-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
GMail normally have a 25mb daily limit on sending. Is it this limit being exceeded? If so you can extend to 5gb with Google drive (see their readme)

Also maybe you are sometimes sending too many CCs at a time for these free emails to handle? Some of them may get lost.

Can't you test your sender system by just opening up a another Yahoo or gmail account with another name and send to say 5000 single emails every 10 seconds? Then trying various numbers of CCs in an email (if you can send multiple CCs to yourself).

You can use the same dll to receive them and count them to save time.

With some regular paid services you can send to yourself but I notice you cant send to yourself sending and receiving on the free GMail or Yahoo.

The mind boggles that students on a bus would be using their phones or even have them on on the bus to school let alone own a mobile phone!
The average student has lost the ability to speak in a coherent human language now - you don't want to encourage them further!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top