D
David Logan
Howdy,
Can somebody tell me why the error number that occurs when you do a
send with an invalid email address keeps changing. The Description is
always the same but the error number changes. Here is the code I am
using below:
Dim objOutlook As Outlook.Application
Dim objMail As Outlook.MailItem
sEmail =
Set objOutlook = New Outlook.Application
Set objMail = objOutlook.CreateItem(olMailItem)
objMail.Recipients.Add ("test")
objMail.Subject = "Welcome To Test"
objMail.Body = "This is a test email"
On Error Resume Next
objMail.Send
If Err.Number <> 0 Then
MsgBox "Outlook Error:" & Err.Number & vbCrLf & "Description:"
& Err.Description
End If
On Error GoTo 0
Set objMail = Nothing
I am wanting to trap the error and report the recipients that are not
valid but don't feel comfortable saying that any error that occurs on
the send is because the recipient is bad.
Thanks
DL
Can somebody tell me why the error number that occurs when you do a
send with an invalid email address keeps changing. The Description is
always the same but the error number changes. Here is the code I am
using below:
Dim objOutlook As Outlook.Application
Dim objMail As Outlook.MailItem
sEmail =
Set objOutlook = New Outlook.Application
Set objMail = objOutlook.CreateItem(olMailItem)
objMail.Recipients.Add ("test")
objMail.Subject = "Welcome To Test"
objMail.Body = "This is a test email"
On Error Resume Next
objMail.Send
If Err.Number <> 0 Then
MsgBox "Outlook Error:" & Err.Number & vbCrLf & "Description:"
& Err.Description
End If
On Error GoTo 0
Set objMail = Nothing
I am wanting to trap the error and report the recipients that are not
valid but don't feel comfortable saying that any error that occurs on
the send is because the recipient is bad.
Thanks
DL