graviz
Registered User.
- Local time
- Today, 09:48
- Joined
- Aug 4, 2009
- Messages
- 167
I've started reading about sending e-mail from Access and was wondering if anyone has a good tutorial for it. Here's a piece of code I found but would like the ability to further format it. I used to know html but I'm not sure how to use it in the code. Has anyone seen anything where it gives you the code and then shows you what it actually will look like in an e-mail?
Dim OL As Object, MailSendItem As Object
Dim cust, prog, mess
Set OL = CreateObject("Outlook.Application")
Set MailSendItem = OL.CreateItem(olMailItem)
With MailSendItem
.Subject = "Routing:" & "Please complete the Sales Block and Close"
.HTMLBody = .HTMLBody & "<body><font color=#ff0000>"
.HTMLBody = .HTMLBody & "<p>Customer: " & cust & "</p>"
.HTMLBody = .HTMLBody & "<p>Program: " & prog & "</p>"
.HTMLBody = .HTMLBody & "<p>Subject: " & mess & "</p>"
.HTMLBody = .HTMLBody & "<p>Please complete the First Sales Block and Close</p>"
.HTMLBody = .HTMLBody & "</font></body>"
.To = ""
.CC = ""
.Attachments.Add
.Importance = 2 ' olImportanceHigh
.Display
.Send
End With
Dim OL As Object, MailSendItem As Object
Dim cust, prog, mess
Set OL = CreateObject("Outlook.Application")
Set MailSendItem = OL.CreateItem(olMailItem)
With MailSendItem
.Subject = "Routing:" & "Please complete the Sales Block and Close"
.HTMLBody = .HTMLBody & "<body><font color=#ff0000>"
.HTMLBody = .HTMLBody & "<p>Customer: " & cust & "</p>"
.HTMLBody = .HTMLBody & "<p>Program: " & prog & "</p>"
.HTMLBody = .HTMLBody & "<p>Subject: " & mess & "</p>"
.HTMLBody = .HTMLBody & "<p>Please complete the First Sales Block and Close</p>"
.HTMLBody = .HTMLBody & "</font></body>"
.To = ""
.CC = ""
.Attachments.Add
.Importance = 2 ' olImportanceHigh
.Display
.Send
End With