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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent Outlook from validating email address

Status
Not open for further replies.

MikeAuz1979

Programmer
Aug 28, 2006
80
AU
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
 
Does it help to Dim Recip As Outlook.Recipient

Probably not, but worth playing with.

Also, in the code I use for Outlook mailing ( there's an explicit "resolve addresses" step - you could try adding something like that in and trapping (or not, in your case, certain errors.

For Each objOutlookRecip In objOutlookMsg.Recipients
objOutlookRecip.Resolve
Next
 
Thanks mp9!,

Dimming the recipient didn't help and the curious thing is that my email address 'person@0299990000@EFAX' passes this .resolve step but I still get the same error on the .send line.

Would anyone else have any ideas?
 
RightFax has an API that you might be able to use to send the fax directly to it. Also, there appears to be an option were you can send the fax to the RightFAX print queue, but I don't think this is what you want. Here's a link to their message board with some info:
 
What happens if you replace .Send with .Display ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
You need to use the Collabrative Data Object functions (CDONT) rather than the Outlook object thereby bypassing outlook altogether
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top