sending HTML email from another page

Results 1 to 2 of 2

Thread: sending HTML email from another page

  1. #1
    Join Date
    Dec 1969

    Default sending HTML email from another page

    Hi,<BR><BR>I&#039;m trying to get a page containing HTML to be sent as an email from another page - the code I am using at the moment is:<BR><BR><BR>&#060;%<BR>Function Mailbody<BR>on error resume next <BR>Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")<BR>&#0 39; Call the remote machine the request <BR> "POST", SiteRoot & "email.asp", False<BR>objXML.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded" <BR>&#039;objXML.send("OrderID=" & OrderID) <BR>objXML.send("OrderID=16")<BR>&#039; return the response <BR>Mailbody = objXML.responsetext <BR>&#039; clean up <BR>Set objXML = Nothing <BR>End Function <BR>%&#062;<BR><BR>However, my hosts server is bringing back the error...<BR><BR><BR>msxml3.dll error &#039;80072efd&#039;<BR><BR>A connection with the server could not be established<BR><BR>/Functions_email.asp, line 57<BR><BR>I know how to solve that, but my hosts are not willing to make the change (ie. configure MSXML2.ServerXMLHTTP correctly)<BR><BR>Therefore, does anyone know of any other code I can use that will enable me to pass a variable to a page then send that page as an HTML email?<BR><BR>My complete code, to make more sense of this is:<BR><BR><BR>&#060;%<BR>&#039;Start the functions<BR>function SendEmail<BR>Set objMail = Server.CreateObject("CDONTS.NewMail")<BR>objMail.F rom = ""<BR>objMail.To = CustomersRS("CustomerEmail")<BR>objMail.Subject = "Order from Products website"<BR>objMail.Body = Mailbody<BR>objMail.MailFormat=0<BR>objMail.BodyFo rmat=0<BR>objMail.Send<BR>Set objMail = Nothing<BR>end function<BR><BR>function SiteRoot<BR>&#039;This function tries to ascertain the site root. If it&#039;s wrong, enter your own manually<BR>CurrentPage=Request.ServerVariables("S CRIPT_NAME")<BR>SiteRoot="http://" & Request.ServerVariables("SERVER_NAME") & left(CurrentPage,instrrev(CurrentPage,"/"))<BR>end function<BR><BR>Function Mailbody<BR>on error resume next<BR>Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")<BR>&#0 39; Call the remote machine the request<BR> "POST", SiteRoot & "email.asp", False<BR>objXML.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"<BR>objXML.send("OrderID=" & OrderID)<BR>&#039; return the response<BR>Mailbody = objXML.responsetext<BR>&#039; clean up<BR>Set objXML = Nothing<BR>End Function<BR>%&#062;<BR><BR>Thanks,<BR><BR>Peter<BR ><BR>DWMX / IIS5.1 / Win XP Pro / VBScript / ASP / PHP / MSAccess 2000 / SQL Server 2000 / mySQL<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default ** CROSSPOST<BR><BR>C raig.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts