MikeAuz1979
Programmer
Hi all,
I need to send an email from Access 2000 (Using Outlook 2003) to a rightfax address which isn't in the usual email format eg 'person@0299990000@EFAX'. (Same issue as thread705-1228663)
The error I get is "outlook does not recognise one or more names." when I step through the '.send' line.
So does anyone have any idea how to prevent outlook from validating email addresses before sending?
Thanks heaps for any help!
Mike
Below is the code I'm using:
Sub OutlookMail()
'Tested ok for Multiple Recips and when Outlook is closed.
Recip = "person@0299990000@EFAX"
ccRecip = "me@me.com"
Freq = "Monthly"
Con = True
ReplyTo = "me@me.com"
Dim objOutlook As Outlook.Application
Dim objEMail As Outlook.MailItem
Set objOutlook = CreateObject("outlook.application")
Set objEMail = objOutlook.CreateItem(olMailItem)
subject = Freq & " Consumption Information"
If Con = True Then
bodytext = "Please find attached your consumption information." & vbCrLf & "If you have any queries please simply reply to this email."
Else
bodytext = "Please note you have no recorded consumption for last month." & vbCrLf & "If you have any queries please simply reply to this email."
End If
With objEMail
.To = Recip
.cc = ccRecip
.subject = subject
.body = bodytext
.SentOnBehalfOfName = ReplyTo
.Save
.Send
End With
Set objOutlook = Nothing
Set objEMail = Nothing
End Sub
I need to send an email from Access 2000 (Using Outlook 2003) to a rightfax address which isn't in the usual email format eg 'person@0299990000@EFAX'. (Same issue as thread705-1228663)
The error I get is "outlook does not recognise one or more names." when I step through the '.send' line.
So does anyone have any idea how to prevent outlook from validating email addresses before sending?
Thanks heaps for any help!
Mike
Below is the code I'm using:
Sub OutlookMail()
'Tested ok for Multiple Recips and when Outlook is closed.
Recip = "person@0299990000@EFAX"
ccRecip = "me@me.com"
Freq = "Monthly"
Con = True
ReplyTo = "me@me.com"
Dim objOutlook As Outlook.Application
Dim objEMail As Outlook.MailItem
Set objOutlook = CreateObject("outlook.application")
Set objEMail = objOutlook.CreateItem(olMailItem)
subject = Freq & " Consumption Information"
If Con = True Then
bodytext = "Please find attached your consumption information." & vbCrLf & "If you have any queries please simply reply to this email."
Else
bodytext = "Please note you have no recorded consumption for last month." & vbCrLf & "If you have any queries please simply reply to this email."
End If
With objEMail
.To = Recip
.cc = ccRecip
.subject = subject
.body = bodytext
.SentOnBehalfOfName = ReplyTo
.Save
.Send
End With
Set objOutlook = Nothing
Set objEMail = Nothing
End Sub