B
bobdydd
Access 2000
I am using the following code to create an email and send it to my
Outlook 2000 Outbox..and everything works OK.
Since I have upgraded to Outlook 2003 there appears to be a set of
apostrophes around the email addresses.......which unless I am barking
up the wrong tree....marks the email as spam and causes my ISP to
reject and not send it.
If I manually type the same address directly into Outlook 2003 ...no
problem. So there must be some security in Outlook 2003 that adds the
apostrophes if another program tries to put and email directly into the
Outbox.
I can put it into the drafts folder........but I don't want to do that
Would the Redemption dll avoid this problem and how do I rewrite the
code below using Redemption.
Thanks for looking
Private Sub CmdEmail_Click()
'Declarations
Dim EmailTo As String
Dim Subject As String
Dim Contents As String
Dim OL As Outlook.Application
Dim OLNS As Outlook.NameSpace
Dim MailFolder As Outlook.MAPIFolder
Dim MyMail As Outlook.mailItem
Set OL = CreateObject("Outlook.Application")
Set MyMail = OL.CreateItem(olMailItem)
Set OLNS = OL.GetNamespace("MAPI")
Set MailFolder = OLNS.GetDefaultFolder(olFolderOutbox)
'Name Fields
EmailTo = Nz(Me!EmailTo, "") ' email address TO
Subject = Nz(Me!Subject, "") ' the subject of the email
Contents = Nz(Me!Body, "") ' the body of the email
'Prepare Mail
With MyMail
.To = EmailTo
.Subject = Subject
.Body = Body
.Send
End With
'Clean up Code
Exit_Here:
Set MailFolder = Nothing
Set OL = Nothing
Set OLNS = Nothing
Set MailFolder = Nothing
Set MyMail = Nothing
Exit Sub
End Sub
I am using the following code to create an email and send it to my
Outlook 2000 Outbox..and everything works OK.
Since I have upgraded to Outlook 2003 there appears to be a set of
apostrophes around the email addresses.......which unless I am barking
up the wrong tree....marks the email as spam and causes my ISP to
reject and not send it.
If I manually type the same address directly into Outlook 2003 ...no
problem. So there must be some security in Outlook 2003 that adds the
apostrophes if another program tries to put and email directly into the
Outbox.
I can put it into the drafts folder........but I don't want to do that
Would the Redemption dll avoid this problem and how do I rewrite the
code below using Redemption.
Thanks for looking
Private Sub CmdEmail_Click()
'Declarations
Dim EmailTo As String
Dim Subject As String
Dim Contents As String
Dim OL As Outlook.Application
Dim OLNS As Outlook.NameSpace
Dim MailFolder As Outlook.MAPIFolder
Dim MyMail As Outlook.mailItem
Set OL = CreateObject("Outlook.Application")
Set MyMail = OL.CreateItem(olMailItem)
Set OLNS = OL.GetNamespace("MAPI")
Set MailFolder = OLNS.GetDefaultFolder(olFolderOutbox)
'Name Fields
EmailTo = Nz(Me!EmailTo, "") ' email address TO
Subject = Nz(Me!Subject, "") ' the subject of the email
Contents = Nz(Me!Body, "") ' the body of the email
'Prepare Mail
With MyMail
.To = EmailTo
.Subject = Subject
.Body = Body
.Send
End With
'Clean up Code
Exit_Here:
Set MailFolder = Nothing
Set OL = Nothing
Set OLNS = Nothing
Set MailFolder = Nothing
Set MyMail = Nothing
Exit Sub
End Sub