T
Tim
When I send an Email via vbScript formatted as HTML, the Outlook New Mail
Desktop Alert indicates "HTML <end>" rather than the body of the Email.
How can I get the Alert to indicate the body of the Email.
Thanks in advance,
Tim
Option Explicit
Dim sFrom, sTo, sSubject, sBody
sFrom = "(e-mail address removed)"
sTo="(e-mail address removed)"
sSubject="Subject"
sBody="This is the Body line 1<br>"
sBody=sBody & vbcrlf & "This is the Body line 2<br>"
sBody=sBody & vbcrlf & "This is the Body line 3<br>"
sBody=sBody & vbcrlf & "This is the Body line 4<br>"
sBody=sBody & vbcrlf & "This is the Body line 5<br>"
sBody=sBody & vbcrlf & "This is the Body line 6<br>"
Mail sFrom, sTo, sSubject, sBody
WScript.Echo "Complete"
Function Mail(sFrom, sTo, sSubject, sBody)
Dim oCon, oMsg
Set oMsg = CreateObject("CDO.Message")
Set oCon = CreateObject ("CDO.Configuration")
With oCon
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"mailhost.pge.com"
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25 'SMTP port
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'CDO Port
..Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 'Timeout
.Fields.Update
'Update the CDOSYS Configuration
End With
Set oMsg.Configuration = oCon
With oMsg
.From = sFrom
.To = sTo
.Cc = ""
.Subject = sSubject
.TextBody="HTML" 'E-mail body format (HTMLBody=HTML TextBody=Plain)
.HTMLBody = sBody
.Send
'Send the e-mail
End With
Set oMsg = Nothing
'Close the server mail object
Set oCon = Nothing
End Function
Desktop Alert indicates "HTML <end>" rather than the body of the Email.
How can I get the Alert to indicate the body of the Email.
Thanks in advance,
Tim
Option Explicit
Dim sFrom, sTo, sSubject, sBody
sFrom = "(e-mail address removed)"
sTo="(e-mail address removed)"
sSubject="Subject"
sBody="This is the Body line 1<br>"
sBody=sBody & vbcrlf & "This is the Body line 2<br>"
sBody=sBody & vbcrlf & "This is the Body line 3<br>"
sBody=sBody & vbcrlf & "This is the Body line 4<br>"
sBody=sBody & vbcrlf & "This is the Body line 5<br>"
sBody=sBody & vbcrlf & "This is the Body line 6<br>"
Mail sFrom, sTo, sSubject, sBody
WScript.Echo "Complete"
Function Mail(sFrom, sTo, sSubject, sBody)
Dim oCon, oMsg
Set oMsg = CreateObject("CDO.Message")
Set oCon = CreateObject ("CDO.Configuration")
With oCon
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"mailhost.pge.com"
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25 'SMTP port
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'CDO Port
..Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 'Timeout
.Fields.Update
'Update the CDOSYS Configuration
End With
Set oMsg.Configuration = oCon
With oMsg
.From = sFrom
.To = sTo
.Cc = ""
.Subject = sSubject
.TextBody="HTML" 'E-mail body format (HTMLBody=HTML TextBody=Plain)
.HTMLBody = sBody
.Send
'Send the e-mail
End With
Set oMsg = Nothing
'Close the server mail object
Set oCon = Nothing
End Function