View Full Version : ASPMail Contact Form from Secure SMTP Server

07-30-2007, 12:46 PM
Hi All,

I hoping someone will be able to help me. My hosts have secure SMTP servers due to some spammers so I have encoded all my contact forms using authenticated smtp. The problem I am having is that I cannot send the email using the details provided by the user, i.e. I cannot use the email address the user is providing. So what I have done is created an email box on the server (for each domain mind you) which I use to send the email from. The problem is though that people generally simply click reply and send, but this will result in email being sent to my email box and the user who submitted the form. below is my code. Any help on how I can get around this will be appreciated:

Dim aspEMail
Set aspEMail = Server.CreateObject("Persits.MailSender")

emailSubject = "Website enquiry"
emailBodyText = "text"

aspEmail.Host = "mail.domain.com"
aspEmail.Username = "webemail@domain.com"
aspEmail.Password = "webpassword"

emailFrom = FilterCchar(FTGemail)
aspEmail.From = "webemail@domain.com"
aspEmail.FromName = "Website Enquiry"
aspEMail.AddAddress "info@domain.com"

aspEmail.Subject = emailSubject
aspEmail.Body = emailBodyText
aspEmail.Charset = "ISO-8859-1"
aspEmail.ContentTransferEncoding = "8bit"



I would like to have:

aspEmail.From = "WebsiteVisitorsName@theirdomain.com"
aspEmail.FromName = "WebsiteVisitorsName

but this not work as for some reason the server needs to authenicate on the email address being used as FROM?

Any ideas?


07-30-2007, 02:54 PM
Your host probably has 2 forms of SMTP authentication -- Connection (as demonstrated by your aspEmail.Host, aspEmail.Username, and aspEmail.Password) and either Sender Authentication or Reverse DNS.

You may want to try:

aspEmail.From = "webemail@domain.com"
aspEmail.FromName = "Website Enquiry"
aspEMail.AddAddress "info@domain.com"
aspEMail.AddAddress "WebsiteVisitorsName@theirdomain.com"
aspEMail.AddReplyTo "WebsiteVisitorsName@theirdomain.com"
Subject = "Website enquiry"
if WebsiteVisitorsName <> "" then
Subject = Subject & " from " & WebsiteVisitorsName
end if
aspEmail.Subject = Subject

Although this doesn't completely solve your problem, it ensures that the personalization of the automatic email is accomplished.

You will have to ask your Hosting Company for more information about the way they handle outbound SMTP.