If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Sending mail from asp page with SMPTsvg.Mailer

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-01-07, 15:33
garp2100 garp2100 is offline
Registered User
 
Join Date: Oct 2006
Posts: 7
Sending mail from asp page with SMPTsvg.Mailer

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

Code:
<%
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
%>
Reply With Quote
  #2 (permalink)  
Old 04-30-07, 12:17
khurram007 khurram007 is offline
Registered User
 
Join Date: Apr 2007
Posts: 29
The syntax is wrong according to the component. The correct syntax for that line is this:

Code:
Mailer.AddRecipient "Name", "name@yourdomain.com"
Notice that it is separated into two parts. The first part ("Name") can be any name or an email address. The second part ("name@yourdomain.com") must be a valid Email address.

Hope this helps,

Khurram.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On