Did not receive email via CDO.message

E

Eka1618

Hello,

I am trying to set up an e-mail message using the code below. When I call
the function, I think the message sends, but I do not know where to find
it....

I am sending myself an email to test out the code. I currently use Outlook
so I would assume that the message should be reveieved there, however, I
never got it.

I was using a script that used the Microsoft Outlook 12.0 reference library,
but I could not seem to get rid of the "send email on behalf of" warning on
PC's using the runtime version of Access 2007. I am trying this new method,
but I do not know much about it and I do not know where the email went.

If anyone knows what I can do, please let me know, Thank You!

Sub sndEmail()

Dim iMsg
Dim iConf
Dim Flds
Dim strHTML
'Dim iBp As CDO.IBodyPart
'Dim iMsg As New CDO.Message

Const cdoSendUsingPort = 2

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")

Set Flds = iConf.Fields


With Flds
'.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
cdoSendUsingPort
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServerPort) = 25
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"mcg144.NTDOMAIN.COM"

..Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 10
.Update
End With


With iMsg
Set .Configuration = iConf
.To = CurrentDb.Properties("RequestorEmail")
'.CC = "(e-mail address removed)"
.From = CurrentDb.Properties("RequesteeEmail")
.Subject = emailSubject
.HTMLBody = "<h2 align = center><b><font color = red>Product Test
Request Due Date Changed (Test Requestor Next
Action)</font></b></h2><br><br>" & emailBody
.Send
End With

Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

End Sub
 
E

Eka1618

The company I work for is blocking the e-mails that I send out this way. I
think it is a setting on Windows. It says that the e-mails are spam...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top