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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending mail from ASP page with SMTPsvg.Mailer

Status
Not open for further replies.

garp2100

MIS
Oct 20, 2006
15
US
Hello Everyone, I'm trying to set up a page where a form gets emailed directly from the page, I've done some research and implemented some code that worked previously on our site under different conditions, I have looked and looked again, any help or insight would be greatly appreciated. Thank you

PS: my error message is: Microsoft VBScript runtime error '800a01b6' Object doesn't support this property or method: 'Mailer.AddRecipient' /mv_thankyou.asp, line 111

<%
If (request.Form("name") <> "") then
dim strName, strEmail, strText

strEmail = Trim(request.Form("email"))

strName = request.Form("name")

strText = "E-mail from: " & strName & "From email address:"

else
response.Redirect("mv_application_counselor.asp")
end if

set Mailer=Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "Mail Subject"
Mailer.FromAddress ="mail@mail.com"
Mailer.RemoteHost ="localhost"
Mailer.AddRecipient="strEmail" '(error line 111)
Mailer.Subject ="Thanks for volunteering!"
Mailer.BodyText strText
if Mailer.SendMail then

Response.Write "Mail sent..."

else

Response.Write "Mail send failure. Error was " & Mailer.Response

end if

set Mailer=Nothing
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top