Hey,
I have a question on how to send emails from VBA.
I have the basic code below to email text, i have added bits into the email body, example would be:
Hello, **USER**,
email, email, email......
Code:
Set emailObj = CreateObject("CDO.Message")
emailObj.From = "EMAIL"
emailObj.To = Me.EmailAddress.Value
emailObj.Subject = "Subject"
emailObj.TextBody = "EMAIL BODY"
Set emailConfig = emailObj.Configuration
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = ""
'Exclude the following line
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = ""
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = ""
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = ""
emailConfig.Fields.Update
emailObj.Send
I am looking for / wondering if there is a way of using a HTML template from an external location (website)
So this would use the HTML template:
Hello
%Users name%,
Your username is:
%Username%
Your Password:
%Password%
Bla, Bla, Blaa.......
Location: Website.com/EMAILS/Template.html
From the code above..
Is this possible / Any advice. I have looked on the site, but can't see anything.
Thanks