Foundas
05-12-2005, 08:17 AM
Hi all,
i am facing the following problem. I am using sendhtmlmail function to send emails.
I use a different file as basic format (payment.htm) and i substitute its fields according to my user.
-------------------------------------------------------------------------
msgl=getfile("payment.htm")
msg1=replace(msgl,"#username#",rs2("username"))
msg1=replace(msg1,"#firstname#",rs2("firstname"))
msg1=replace(msg1,"#date#",rs3("date"))
msg1=replace(msg1,"#desc#",rs1("name") & " (" & rs1("credits") & " credits.)")
msg1=replace(msg1,"#amount#",rs1("amount"))
msg1=replace(msg1,"#credits#",rs1("credits"))
msg1=replace(msg1,"#validity#",rs1("validity"))
msg1=replace(msg1,"#payment#",rs3("transaction"))
msg1=replace(msg1,"#email#",rs2("email"))
sendhtmlmail " <info@domain.com >",rs2("email"),"Receipt for Payment",msg1
-----------------------------------------------------------------------
this is the sendhtmlmail function:
sub sendhtmlmail(from,too,subject,body)
Set MyMail = CreateObject("cdo.message")
MyMail.From = from
MyMail.To = too
MyMail.Subject = subject
MyMail.TextBody = body
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.domain.com"
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
MyMail.Configuration.Fields.Update
MyMail.Send
end sub
here is the problem. The email is sent successfully, the fields are updated correctly, but in the body of the email i see the HTML code of payment.htm. <body><head> etc etc.
please advice on how to fix this
thanks in advance,
Foundas
i am facing the following problem. I am using sendhtmlmail function to send emails.
I use a different file as basic format (payment.htm) and i substitute its fields according to my user.
-------------------------------------------------------------------------
msgl=getfile("payment.htm")
msg1=replace(msgl,"#username#",rs2("username"))
msg1=replace(msg1,"#firstname#",rs2("firstname"))
msg1=replace(msg1,"#date#",rs3("date"))
msg1=replace(msg1,"#desc#",rs1("name") & " (" & rs1("credits") & " credits.)")
msg1=replace(msg1,"#amount#",rs1("amount"))
msg1=replace(msg1,"#credits#",rs1("credits"))
msg1=replace(msg1,"#validity#",rs1("validity"))
msg1=replace(msg1,"#payment#",rs3("transaction"))
msg1=replace(msg1,"#email#",rs2("email"))
sendhtmlmail " <info@domain.com >",rs2("email"),"Receipt for Payment",msg1
-----------------------------------------------------------------------
this is the sendhtmlmail function:
sub sendhtmlmail(from,too,subject,body)
Set MyMail = CreateObject("cdo.message")
MyMail.From = from
MyMail.To = too
MyMail.Subject = subject
MyMail.TextBody = body
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.domain.com"
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
MyMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
MyMail.Configuration.Fields.Update
MyMail.Send
end sub
here is the problem. The email is sent successfully, the fields are updated correctly, but in the body of the email i see the HTML code of payment.htm. <body><head> etc etc.
please advice on how to fix this
thanks in advance,
Foundas