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

I need the Code for automatically sending emails in access!!

Status
Not open for further replies.

lucylu

Programmer
Jun 1, 2001
3
0
0
US
I need my access program to automatically send emails looking up given dates and I need the text to appear as a regular email, not as an attachment. I would like to use Outlook to send emails through access but be able to keep my current server for sending and receiving mail. Can anyone help me??

Thanks so much in advance for any and all help!!
 
Hi LucyLU
here you got it

Put this in your field doble clic event:

Private Sub email_DblClick(Cancel As Integer)
On Error Resume Next
Dim strKey As String
'GetOutLook
strKey = Me.email
Application.FollowHyperlink "Mailto:" & strKey, , True
DoCmd.SendObject acSendNoObject, , , Me![general conact email]


This was post it by Doup Poston in one of his Thread, and it work fine for me.
 
Thanks again for your help, I will definately try this!!

lulu
 
I got this code to work where it brings up the New Message page and enters the 'Mail to' recipient.

What I need now is for it to lookup a date that is in a text box on a form then make the "Mail To" equal to the email address that is in another text box on the same form. Is this possible?

Also, where do I write the message that I want to have sent?

I am stuck, I do not work with emailing much. Please help!!

Thanks!!
 
To generate the code for your Email, define a macro using Send Object, complete all the entries then save it as a Module. This will generate the code for the Email itself.

To use a Date from a Text box... you will have to decide how you want to activate the Email. You could use the OnClick event of a button and just enter the code for your EMail using.....

If "txtBoxDate" = WHATEVER Then
Code for sending Email i.e... DoCmd.SendObject acTable, "Entitlements", "RichTextFormat(*.rtf)", "", "", "", "Memo", "Hello Bert", False, ""
Else
Exit sub
End if

Hope that Helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top