Hi, I have a rather old ASP project I like put up on my Winhost web server account. I get the (HTTP 500 Internal Server Error) when the page tries to send emails, and I'm guessing I have to include SMTP authorization for my mail account to the script. But I don't know how... Can someone show me the light? Thank you! ********************************************************** sub SendMail() bodyHTML = "<b>Welcome to My Site!</b><br><br>Your user name is: " & username &_ "<br>Your password is: " & password &_ "<br>Your email is: " & email &_ "<br>Your group is: " & category &_ "<br><br>For questions or comments please send email to <a href='mailto:[email protected]'>[email protected]</a>." &_ "<br><b>Have a nice day...</b><br><br><img src='smile.gif'>" set myMail = server.CreateObject("CDONTS.NewMail") myMail.BodyFormat = 0 myMail.MailFormat = 0 myMail.From = "[email protected]" myMail.To = email myMail.Subject = "Welcome, " & username & "!" myMail.Body = bodyHTML myMail.AttachURL Server.MapPath("smile.gif"), "smile.gif" myMail.Send set myMail = nothing end sub **********************************************************
I'm afraid CDONTS is not supported. You might try one of these: How to send mail using CDO How to send email in ASP.NET How to send email from a php application
Oh I see. I will look into CDO, to keep to the theme of the project. Thank you for your response. Can you elaborate on the reason why CDONTS is not supported? Old? Security? Just curious.
Well that code stinks. The person gets the body of the message ok but he or she doesn't know who sent the message. In the form. It should request at lease a e-mail address and a submit button I'm talking to the guy that gave this link in the above thread https://support.Winhost.com/KB/a650/how-to-send-email-in-aspnet.aspx Did a real quick search on Google and found this. http://www.asp.net/web-pages/tutorials/email-and-search/11-adding-email-to-your-web-site At lease this code ask for a e-mail address and a subject line
It does include a from address, and it's sample code, it isn't meant to be something you can cut and paste into a page and have a perfect one-size-fits-all contact form.