473,543 Members | 2,496 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there a way to verify that an email was sent?

Seth Schrock
2,965 Recognized Expert Specialist
I'm using the following code to send emails from my database:
Expand|Select|Wrap|Line Numbers
  1. Public Sub SendEmail(strSubject As String, strText As String, _
  2.                 strTo As String, Optional strFrom As String)
  3.  
  4. Dim cdoConfig As Object
  5. Dim msgOne As Object
  6.  
  7. Set cdoConfig = CreateObject("CDO.Configuration")
  8. With cdoConfig.Fields
  9.     .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
  10.     .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 25
  11.     .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "Exchange.ftc.com"
  12.     .Update
  13. End With
  14.  
  15. If strFrom & "" = "" Then strFrom = "Database_Notification@fountaintrust.com"
  16.  
  17. Set msgOne = CreateObject("CDO.Message")
  18. Set msgOne.Configuration = cdoConfig
  19.  
  20. With msgOne
  21.     .To = strTo
  22.     .From = strFrom
  23.     .Subject = strSubject
  24.     .TextBody = strText
  25.     .Send
  26. End With
  27.  
  28. Set cdoConfig = Nothing
  29. Set msgOne = Nothing
  30.  
  31. End Sub
I would like to be able to verify that the email was sent. I know that delivery confirmation requests can be used, but that is dependent on the receiver allowing it to be sent so it isn't totally dependable.

The other idea that I had was change it from a sub to a function and use it as a flag of some sort. I would just have to trust that since the email addresses are saved in the database that they are accurate. If there was an error going through the code, then the error handler would set the function to 1. If the function didn't have an error, then the function would return a 0. Is this a valid idea or does it make me worthy of brain surgery to fix the cobwebs in my brain?
Feb 26 '13 #1
3 6612
Rabbit
12,516 Recognized Expert Moderator MVP
If the code runs without error then the e-mail was probably sent.

Whether or not it arrived at it's destination is another question. If you don't get an e-mail saying that the mail server was not found, then it probably arrived at it's destination.

And whether or not the target opened it is yet another question. You could use read confirmations, but that's not accurate. Some people use a 1x1 image that is linked to the server by an ID to find out if an e-mail was opened. But some e-mail applications block images from loading for that very purpose. So that's not completely reliable either but is more so than the other option.
Feb 26 '13 #2
zmbd
5,501 Recognized Expert Moderator Expert
ahh... think I just found my reference link:
Sending mail from Excel with CDO
I know... it says Excel; however, it covers the CDO method.

In an excel add-in that I have, I use this method to send error messages to me. We used to use "Groupwise" as our email... here I was looking thru my Access references and it was from my old Excel97 work.
Feb 26 '13 #3
Seth Schrock
2,965 Recognized Expert Specialist
So basically, I can use my function idea to make sure that the code ran without an error. This would mean that the email was sent. I guess I can play with delivery notifications and see what that tells me.

Is there a way to trap for an error of a bad email address? Maybe I just need to add a reply to address so that delivery errors get sent to me by coding my email address into the reply to address.
Feb 27 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
5267
by: vishal | last post by:
how can i verify the email address entered by client??? is there any readily available function for that in php or mysql????? else suggest me some links for verifying email address enetered by client. thxs for help in advance.
5
5660
by: Dan Williams | last post by:
Apologies for the cross-post but i thought i'd aim for the largest audience possible. I have a web site that users have to register to with their email address. The site then emails the user their password via Exchange 2000 and ASP/VBScript and CDO. Does anyone know if its possible to verify that the email address exists before sending...
2
1651
by: Cherry | last post by:
Hi, I have an intranet application that should validate the Email Address from the local SMTP Server. I have tried using CDO.Message but that does not seem to have functionality to verify the Email. Please do let me know the approach for this.
0
1121
by: Imran Aziz | last post by:
Hello All, I am using System.Net.Mail (.net 2) class to send out emails. What I want to do is set the property in the email sent to expire after 24 hours. This can be done in Outlook by using the options tab in the new message window. How can this be done using these classes or any other method programmatically ? What I want is the email to...
2
5256
by: Wayne Wengert | last post by:
I want to write a Windows application to go through all the email addresses in an SQL Server table and to report which ones are invalid. From Googling and perusing NGs it is my understanding that the process to validate an email address is done at 3 levels: 1. Verify that it is syntactically valid 2. Verify that the domain exists (SMTP...
1
2172
by: sa | last post by:
Hi, Is there a way to get email sent or not with C#. I can understand if I get error message in my yahoo account. But is there a way to get this after SMTPClient.Send method? Regards, Salim
1
2973
by: summer | last post by:
Hello, I'm not receiving my email, I believe I'm almost there, but can't figure out what I'm missing. Any Clue would be appreciated. Here's my html and asp code. I've included the cdovbs.inc file in the root of my website, I thought that maybe my error. Thank you, Summer
1
3134
by: Grey | last post by:
I have to write a program to verify email address availability. i have to verify thousand of email address. is there any way to verify the email in ..net instead. the requirement is to verify which email valid or invalid
3
1807
by: Grey | last post by:
I have to write a program to verify email address availability. i have to verify thousand of email address. is there any way to verify the email in ..net instead. the requirement is to verify which email valid or invalid
0
1488
by: TimeTT | last post by:
I have a problem with an add-in I support when "Send immediately when connected" is unchecked. The add-in is causing the first email sent to sit permanently in the Outbox. This email has Date as None and is in bold but not italics. Any subsequent emails will be as normal (so long as the first one is still blocked in Outbox), going to Outbox with...
0
7408
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7349
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7347
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7688
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5271
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4895
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3391
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3391
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
968
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.