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

Send email directly from access 3

Status
Not open for further replies.

SeadnaS

Programmer
May 30, 2011
214
Is it possible to send email directly from access without using outlook? If so how would I do it? If not is there an easy way to avoid the security pop up where users are required to click "Allow"? Would it be possible to code a VBA email sender in Access?

Hope someone can help!

Thanks in advance.

Seadna.
 
Another note: That security warning was added a few years ago - either to Office 2003 or 2007, I forget when... primarily to keep Spammers from using Outlook to send out SPAM email, best I recall.
 
Google search for outlook object model guard
Another way here:
thread705-1369407

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I downloaded this and im using it through Shell() in VBA seems to work great!
 

set a reference to Microsoft CDO WINDOWS FOR 2000

Dim lobj_cdomsg As CDO.Message
Set lobj_cdomsg = New CDO.Message

lobj_cdomsg.Configuration.Fields(cdoSMTPServer) = "102.16.100.19"
lobj_cdomsg.Configuration.Fields(cdoSMTPConnectionTimeout) = 30
lobj cdomsg.configuration.fields(cdoSMTPServerPort)=25
lobj_cdomsg.Configuration.Fields(cdoSendUsingMethod) = cdoSendUsingPort
lobj_cdomsg.Configuration.Fields.Update
lobj_cdomsg.To = "someclown@bozo.com"
lobj_cdomsg.From = "somebozo@clown.com"
lobj_cdomsg.Subject = "Shoe size"
lobj_cdomsg.TextBody = "What size shoes do you wear?"
lobj_cdomsg.AddAttachment ("\\server\filefolder\myshoes.jpg")
lobj_cdomsg.Send
Set lobj_cdomsg = Nothing


 
Also, one note on this line

lobj_cdomsg.Configuration.Fields(cdoSMTPServer) = "102.16.100.19"

You can use the actual name of the email server instead of the IP as well as in

lobj_cdomsg.Configuration.Fields(cdoSMTPServer) = "MyExchangeServer"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top