|
-
Jun 16th, 2003, 05:16 AM
#1
Thread Starter
Fanatic Member
html email problem
im sending a html email through my miler object.
when i dont include an attachment it works fine, but when i do the message arrives as plain text.
here is the code on the page.
V_HTML = "<html>"
V_HTML = V_HTML+ "<head>"
V_HTML = V_HTML+ "</head>"
V_HTML = V_HTML+ "<body bgcolor='#ffffff'>"
V_HTML = V_HTML+ "<font color='red'>"
V_HTML = V_HTML+ "hahahahahahahahah"
V_HTML = V_HTML+ "</font>"
V_HTML = V_HTML+ "</body>"
V_HTML = V_HTML+ "</html>"
mailto = "dave"
mailattach = ("C:\Inetpub\wwwroot\orion\scripts\test.doc")
V_MAIL_RESULT = SendHtmlMail("your manager",mailtoaddress,"Leave Authorisation Request [EDIT]",V_HTML,mailattach)
and the function
<%
Function SendHtmlMail(mailto,mailtoaddress,subject,mailtext,mailattach)
If Trim(mailtoaddress) <> "" Then
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
rem change this RemoteHost to a valid SMTP address before testing
Mailer.RemoteHost = "smtp.intra.bt.com"
Mailer.FromName = "BILLING SOLUTIONS"
Mailer.FromAddress = "[email protected]"
Mailer.AddRecipient mailto,mailtoaddress
Mailer.Subject = subject
Mailer.BodyText = mailtext
Mailer.ContentType = "text/html"
if trim(mailattach) <> "" then
Mailer.AddAttachment mailattach
end if
if not Mailer.SendMail then
SendhtmlMail = " failed... Error is: <br>" & Mailer.Response
else
SendhtmlMail = "Email sent successfully to "+mailto+" ["+mailtoaddress+"]"
end if
Set Mailer = Nothing
Else
SendhtmlMail = "No email address available! mail not sent."
End If
End Function
%>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|