PDA

View Full Version : HTML/HEX formatting issue with ASPMail


japangreg
12-06-2005, 08:26 PM
Hi, all.

We seem to have developed a small glitch in our 'email me my password' request system: our host recently suffered a massive hardware failure and moved us to a new box running Win. Server 03. Then our sys admin installed new anti-spam hardware and forgot to allow our remote server to get through. Now that the last point has been rectified, the email being sent out is having some formatting issues.

Here is the code I am using:
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.RemoteHost = "our.mail.host.com"
Mailer.ContentType = "text/html"
Mailer.WordWrap = true
Mailer.WordWrapLen = 255
Mailer.FromName = "Website Webmaster"
Mailer.FromAddress = "me@website.com"
Mailer.AddRecipient lname, email
Mailer.Subject = "Your website login and password"
Dim t_Msg
t_Msg = "<html><body>" & vbCrLf
t_Msg = t_Msg & "Dear " & objRS("LabelName").Value & ":" & vbCrLf
t_Msg = t_Msg & "<p>Your login information for the website is:" & vbCrLf
t_Msg = t_Msg & "<br>Username: " & objRS.Fields("strWebID").Value & vbCrLf
t_Msg = t_Msg & "<br>Password: " & objRS.Fields("Password").Value & vbCrLf
t_Msg = t_Msg & "<p>You can log on to the members only section of the website at <a href=""http://www.website.com/members/"">http://www.website.com/members/</a> " & vbCrLf
t_Msg = t_Msg & "<p>If you did not request this information, please contact <a href=""mailto:webmaster@website.com"">webmaster@website.com</a>." & vbCrLf
t_Msg = t_Msg & "</body></html>" & vbCrLf
Mailer.BodyText = t_Msg(the various fields are populated from a database query)

When I receive the email, this is what I see:Dear My Name:
Your login information for the website is:
Username: myUsername
Password: myPassword

You can log on to the members only section of the website= at http://www=2Ewebsite=2Eco= m/members/=2Easp

If you did not request this information, please contact webmaster@website=2Ecom=2EAny ideas as to what might be causing the strange formatting? I've tried reading the documentation, to no avail.

Any help appreciated.

BarrMan
12-06-2005, 08:48 PM
did you make sure that the values of the fields in your records aren't mypassword or myusername?

TheShaner
12-06-2005, 09:03 PM
Barrman, this has nothing to do with his database fields. It's the =2E formatting that is appearing in his message.

Anyway, japangreg, it's strange that only the periods were formatted in that way. No other characters were. I'm guessing it has something to do with the new server that you're on that's affecting your ASPMail. I've found others posting the same problem, but yet to find the results. I'll keep searching and see if I can find anything.

EDIT: Win Server 2003 uses CDO, which is very easy to use for mailing. You could easily transfer your code over to using CDO and that may correct your problem.
http://www.w3schools.com/asp/asp_send_email.asp

-Shane

japangreg
12-06-2005, 09:59 PM
Hey, Guys. Thanks for the replies.

Barrman, TheShaner is right in that the output from the query is fine - the myUsername and myPassword are just there to edit out the sensitive info.

It's not just the periods, actually: it doesn't come through when copy/pasting the message, but the HTML shows that the > and also the = are also being hexed.

I'll check out that link and see what I can do. Thanks again.