By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,805 Members | 1,640 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,805 IT Pros & Developers. It's quick & easy.

Sending Email Message in HTML from Access

100+
P: 114
Hello all,
I'm looking to send an email message from my database at the "click of a button." I've got that part worked out - the only thing is, it sends text only and I would like the message to include our company's fonts, colors, etc.

So, anyone know of a way to have Access 2003 create this message in HTML verses the text only? Code below. Thanks in advance for any help!

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdEmailLetter_Click()
  2. 'Opens Outlook mail message with receipt confirmation and email addresses auto-populated.
  3. On Error GoTo Err_cmdEmailLetter_Click
  4.  
  5. Dim crQ As String
  6. Dim crL As String
  7.     crQ = Chr$(34)
  8.     crL = vbNewLine
  9.  
  10. DoCmd.SendObject acSendNoObject, , , "Enter Client Email Address", "Enter Specialist Email Address", , _
  11.     "Client #" & [ClientID] & " - Notice Notification", _
  12.     [txtSalutation] & crL & crL & [txtBody] & crL & crL & [txtClosing] & crL & crL & [txtContact], True
  13.  
  14. Exit_cmdEmailLetter_Click:
  15.     Exit Sub
  16. Err_cmdEmailLetter_Click:
  17.     MsgBox Err.Description
  18.     Resume Exit_cmdEmailLetter_Click
  19. End Sub
Mar 25 '08 #1
Share this Question
Share on Google+
2 Replies


ADezii
Expert 5K+
P: 8,675
Hello all,
I'm looking to send an email message from my database at the "click of a button." I've got that part worked out - the only thing is, it sends text only and I would like the message to include our company's fonts, colors, etc.

So, anyone know of a way to have Access 2003 create this message in HTML verses the text only? Code below. Thanks in advance for any help!

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdEmailLetter_Click()
  2. 'Opens Outlook mail message with receipt confirmation and email addresses auto-populated.
  3. On Error GoTo Err_cmdEmailLetter_Click
  4.  
  5. Dim crQ As String
  6. Dim crL As String
  7.     crQ = Chr$(34)
  8.     crL = vbNewLine
  9.  
  10. DoCmd.SendObject acSendNoObject, , , "Enter Client Email Address", "Enter Specialist Email Address", , _
  11.     "Client #" & [ClientID] & " - Notice Notification", _
  12.     [txtSalutation] & crL & crL & [txtBody] & crL & crL & [txtClosing] & crL & crL & [txtContact], True
  13.  
  14. Exit_cmdEmailLetter_Click:
  15.     Exit Sub
  16. Err_cmdEmailLetter_Click:
  17.     MsgBox Err.Description
  18.     Resume Exit_cmdEmailLetter_Click
  19. End Sub
Try:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.SendObject acSendNoObject, , acFormatHTML, "Enter Client Email Address", "Enter Specialist Email Address", , _
  2.     "Client #" & [ClientID] & " - Notice Notification", _
  3.     [txtSalutation] & crL & crL & [txtBody] & crL & crL & [txtClosing] & crL & crL & [txtContact], True
Mar 26 '08 #2

100+
P: 114
Thanks, Adezii, for the tip. That unfortunately still produces a plain text email message. I think that applies more so to if I was actually sending a database object with the email. Any other ideas?

Thanks.
Mar 26 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.