MS Access and sending mail via MS Outlook

  • Thread starter Thread starter Miha Abrahamsberg
  • Start date Start date
M

Miha Abrahamsberg

Hello!

I'm using the following to send mail in Access (2003) via Outlook (2003):

Public Function SendEMail(SubjectLine As String, MyBodyText As Variant,
EMailAddress As String, EMailAddressCC As String, path1 As String)
Dim MyOutlook As Outlook.Application
Dim MyMail As Outlook.MailItem

Set MyOutlook = New Outlook.Application

Set MyMail = MyOutlook.CreateItem(olMailItem)
MyMail.To = EMailAddress
MyMail.CC = EMailAddressCC
MyMail.Subject = SubjectLine
MyMail.Body = MyBodyText
MyMail.Attachments.Add path1, olByValue, 1, "My Displayname"

MyMail.Display

Set MyMail = Nothing
Set MyOutlook = Nothing
End Function

I have 2 questions:

1. Every time MS Outlook is prompting me that "something/someone" is trying
to send mail and I have to confirm it. Is there a way to turn this warning
off?

2. I use a txt file to "fill" the "MyBodyText" value. Is there a way to use
rich or html text in this manner?

Thank you in advance!

Miha
 
1. Every time MS Outlook is prompting me that
"something/someone" is trying to send mail and I have to
confirm it. Is there a way to turn this warning off?

Google "Outlook Redemption" and you'll come across things like:

http://www.everythingaccess.com/tutorials.asp?ID=Outlook-Send-E-mail-Without-Security-Warning

2. I use a txt file to "fill" the "MyBodyText" value. Is there
a way to use rich or html text in this manner?

The MailItem object has and HTMLBody property.


Geoff
 
In the emantime I started using SMTP to send e-mails instead of MS Outlook.
This way I have no "security" issues.

Also I tried that "HTMLBody" property you mentioned. It works great.

Thank you!

Miha
 
Back
Top