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

Sending E-Mail from Access

Status
Not open for further replies.

Grandkathy

Technical User
Jan 13, 2005
32
0
0
US
I am using SendObject in order to send an email from access. The To: CC: BCC: Subject: is pulled from a form, and the message text is also on that form, but it's not putting the message text into the message.

The code is as follows:

DoCmd.SendObject acSendReport, "rptinttng_equipment", "RichTextFormat(*.rtf)", [Forms]![frmIntTng_Classes].[LogonIDHold], , , [Forms]![frmIntTng_Classes].[TngCourseNameHold], [Forms]![frmIntTng_Classes].[MsgHold], False

Thanks
 

Try replacing "RichTextFormat(*.rtf)" with "acFormatRTF".

Be careful with the RichTextFormat and attachments, MS KB returns quite a few articles for "*.rtf attachments".

See VB Help for "SendObject Method" or look into the FAQs section for alternatives.


TomCologne
 
Grandkathy,

You can try this also...
txtEmail and txtName are fields in a table.
eSubject and eMessage are unbound textbox(s) on the form.

This will allow you to loop the table and send everyone and email, Or add boolean values to the table to decide who gets the email.

DoCmd.SendObject acSendNoObject, , , txtEmail, _
, , eSubject, txtName & "," & vbcr & eMessage, False

I believe any alternative other then the 'acSendNoObject'
will send it as an attachment. Not sure, it's been a while since I've done any emailing. But the above method should work fine.

If your still having problems
Here's a sample I used to read a text file into a string, then emailed it. thread705-999137
Scroll to may sample, the code is a long, but easy to follow.


AccessGuruCarl
Programmers helping programmers
you can't find a better site.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top