Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

not sending email

Status
Not open for further replies.

keak

Programmer
Sep 12, 2005
247
CA
Hi there,

I am trying to send an email through asp but for some reason, it is not going through

Code:
dim mailbody, mailbody_formatted 
mailbody = Request("message")
mailbody_formatted = Replace(mailbody, "\n", "<br>")

Dim Mail
Set Mail = Server.CreateObject("CDONTS.NewMail")
'Mail.From = Request("email")
'Mail.From = "test@gmail.com"
Mail.To="to_emai@domain.com"
Mail.Subject = "Song: New Landing Page Submit"
Mail.MailFormat = 0
Mail.BodyFormat = 0
Mail.Body = "<table><tr><td><b>First Name: </td><td>" & Request("firstname") & "</td></tr><tr><td><b>Last Name: </td><td>" & Request("lastname") & "<tr><td><b>Home Phone:</td><td> " & Request("homephone") & "</td></tr><tr><td><b>Work Phone:</td><td> " & Request("workphone")  & "</td></tr>   <tr><td><b>Email: </td><td>" & Request("email") & "</td></tr></table>"

Mail.Send

Set Mail=nothing


Im on IIS 6.0 and the defautl SMTP virtual server is switched on.

Any help is much appreciated on this.


Thanks!

 
Hi keak,
I suppose You have not commented the Mail.From = "...." code line in the original script, anyway I think the problem is that your smtp server does not allow your "sender" to deliver emails. So look in the Smtp configuration and allow smtp relay to the sender domain.

IIS Manager -> SMTP Virtual Server (Tree Node)-> Property -> Access (Tab) -> Relay (Button)

Hope it helps!
ZJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top