I think I am missing something really obvious. I have a need to call an email script from vbscript. Everytime I write vbscript I always start it with...
<SCRIPT LANGUAGE="VBScript">
<!--
Sub MyFunction()
End Sub
-->
</SCRIPT>
However the email script does not have the <!-- it has the <% around them as seen below...
<%
Set mySmartMail = Server.CreateObject("aspSmartMail.SmartMail"
mySmartMail.Server = "EmailServer"
mySmartMail.SenderName = "Task User"
mySmartMail.SenderAddress = strMyEmailAddress
mySmartMail.Recipients.Add sEmailAddress, "Task User"
mySmartMail.Subject = strSubjectLine
mySmartMail.Body = "<b>Test Email</b>"
mySmartMail.SendMail
%>
Each of these work seperately but when I try to put them together like this...
<SCRIPT LANGUAGE="VBScript">
<!--
Sub MyFunction(strMyEmailAddress)
<%
Set mySmartMail = Server.CreateObject("aspSmartMail.SmartMail"
mySmartMail.Server = "EmailServer"
mySmartMail.SenderName = "Task User"
mySmartMail.SenderAddress = strMyEmailAddress
mySmartMail.Recipients.Add sEmailAddress, "Task User"
mySmartMail.Subject = strSubjectLine
mySmartMail.Body = "<b>Test Email</b>"
mySmartMail.SendMail
%>
End Sub
-->
Does anyone know how I can make this work? Thanks for you help.
<SCRIPT LANGUAGE="VBScript">
<!--
Sub MyFunction()
End Sub
-->
</SCRIPT>
However the email script does not have the <!-- it has the <% around them as seen below...
<%
Set mySmartMail = Server.CreateObject("aspSmartMail.SmartMail"
mySmartMail.Server = "EmailServer"
mySmartMail.SenderName = "Task User"
mySmartMail.SenderAddress = strMyEmailAddress
mySmartMail.Recipients.Add sEmailAddress, "Task User"
mySmartMail.Subject = strSubjectLine
mySmartMail.Body = "<b>Test Email</b>"
mySmartMail.SendMail
%>
Each of these work seperately but when I try to put them together like this...
<SCRIPT LANGUAGE="VBScript">
<!--
Sub MyFunction(strMyEmailAddress)
<%
Set mySmartMail = Server.CreateObject("aspSmartMail.SmartMail"
mySmartMail.Server = "EmailServer"
mySmartMail.SenderName = "Task User"
mySmartMail.SenderAddress = strMyEmailAddress
mySmartMail.Recipients.Add sEmailAddress, "Task User"
mySmartMail.Subject = strSubjectLine
mySmartMail.Body = "<b>Test Email</b>"
mySmartMail.SendMail
%>
End Sub
-->
Does anyone know how I can make this work? Thanks for you help.