|
-
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
%>
-
Jun 16th, 2003, 10:19 AM
#2
Frenzied Member
Did you receive your attached file?
-
Jun 16th, 2003, 06:09 PM
#3
Lively Member
When you add an attachment, the component probably changes the content type from multipart/alternative to one of the multipart/related or something to handle the attachment. As a result, it's not processing the alternative content... so it spits out the default unformatted text.
Check the component's literature to find out exactly how it functions with attachments. You might have to specify the content-type explicitly, or maybe it's just not possible to have an html-capable email and attachment with that component.
- Steve
"I'm glad I wore these pants."
-
Jun 17th, 2003, 04:36 AM
#4
Thread Starter
Fanatic Member
the help file says that html emails cant be used in conjunction with addattchement.
-
Jun 17th, 2003, 10:07 AM
#5
Frenzied Member
Originally posted by davebat
the help file says that html emails cant be used in conjunction with addattchement.
Is any other alternative e-mail components that you could use?
Who is a hosting copmany? You may need check with them what they got on the server.
-
Jun 17th, 2003, 10:19 AM
#6
Thread Starter
Fanatic Member
thanks, there is no hosting company - I sit about 10 feet away from the server. i think I might just try and use CDONTS. Ive never used it before - will this be possible or is it pretty crappy.
-
Jun 17th, 2003, 11:14 AM
#7
Frenzied Member
CDONTS is a sililar thing. There are would be some programming to handle attachments. you have to upload file to the server first, and then it could be attached to the outgoing message.
look on http://www.4guysfromrolla.com for examples.
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
|