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

Mailer.FromAddress Error? 2

Status
Not open for further replies.

danielh68

Technical User
Jul 31, 2001
431
US
Hi,

I created an ASP form for my company and it works fine. I copied the code so that I could create my own form for my personal site. I emailed my provider and asked them specific info regarding:

1.)Set Mailer = Server.CreateObject ("?????")
2.)Mailer.RemoteHost = "?????"
3.) Mailer.FromAddress = "?????"

They gave me the informatin for these objects, however I have received a runtime error when testing. Below is the exact error:

-------------------------------------------------------
Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'Mailer.FromAddress'

/proto/vision2020_form.asp, line 597
--------------------------------------------------------

I've actually tried removing the 'Mailer.FromAddress' from the code, but it naturally failed as well. Anyhow, I would like to get some feedback before I contact them again. Your help is much appreciated.

Thanks,
DanH
 
Is this CDONTS?

Dim objCDOMail

Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
objCDOMail.From = &quot;<youremail@yourmailserver.com>&quot;


Syntax could be your problem.
I've never heard of the remotehost property. Could it be you're confusing it with ServerVariables?

HTH
 
If the object is the ASPMail object than it the methods you are using are correct, otherwise double check which object you are using.
Here are examples of the first few attributes for three common objects:
ASPMail:
Code:
Set objASPMail = Server.CreateObject(&quot;SMTPsvg.Mailer&quot;)
objASPMail.FromName   = &quot;YourNameHere&quot;
objASPMail.FromAddress= &quot;YourEmail@YourHost.com&quot;
objASPMail.AddRecipient &quot;ToPersonName&quot;, &quot;ToPerson@TheirDomain.com&quot;
objASPMail.RemoteHost = &quot;mailhost.YourSmtpServer.net&quot;
JMail:
Code:
Set objJMail = Server.CreateObject(&quot;JMail.SMTPMail&quot;) 
objJMail.Sender = &quot;YourEmail@YourHost.com&quot; 
objJMail.AddRecipient &quot;ToPerson@TheirDomain.com&quot;
objJMail.ServerAddress = &quot;mailhost.YourSmtpServer.net&quot;
CDONTS
Code:
Set objCDONTS = Server.CreateObject(&quot;CDONTS.Newmail&quot;)
objCDONTS.From = &quot;YourEmail@YourHost.com&quot; 
objCDONTS.To = &quot;ToPerson@TheirDomain.com&quot;
'cannot specify SMTP address with CDONTS

Those are the three most common mail objects and the first few fields. If you let us know which one your host has we could probably help you find resources.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
No more vacation for me :(

FAQ FAQ20-2863
= new Forums.Posting.General.GettingAnswers()
 
Hi, thanks everyone for your responses. I've decided to cut and paste my brief correspondance with my provider so I don't leave out something important:
--------------------------------------------------
Me:
I wish to move an ASP form from another site (& provider) to my FlareHosting
site. Anyhow, I reviewed the code and I believe these snippets need to
be changed in order to work at Flare. Here they are:

1.)<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;&quot;>

2.)Set Mailer = Server.CreateObject (&quot;SMTPsvg.Mailer&quot;)
3.)Mailer.RemoteHost = &quot;mail-fwd.verio-web.com&quot;
4.) Mailer.FromAddress = &quot;support@verio-hosting.net&quot;

Provider:

1. I do not think it needs to be changed.

2. see here for a sample code of the email component we support,

3. host is &quot;mail.blitzdesign.net&quot;

4. from address is &quot;user@blitzdesign.net&quot;
----------------------------------------------------------

So, this is what I have now:
mailTo= Request.Form(&quot;mailTo&quot;) & &quot;myname@sierratel.com&quot;
<!-- note: I'm using another email address carried by another provider, I don't think it should be a problem-->

Set Mailer = Server.CreateObject (&quot;SMTPsvg.Mailers&quot;)
<!--note: I've tried both SMTPsvg.Mailers & Persits.MailSender-->

Mailer.FromAddress = &quot;myname@sierratel.net&quot;
<!--note: I'm using another email address carried by another provider, I don't think it should be a problem-->

Mailer.RemoteHost = &quot;mail.blitzdesign.net&quot;

That's it. Your expertise is greatly appreciated.

Thanks,
Daniel
__________________________________________________________
 
could you post the entire script?
one thing noticable is the mailTo variable.
without a , between the name and address a error will arise.
so it would be benificial to do
Mailer.AddRecipient Request.Form(&quot;mailTo&quot;), &quot;myname@sierratel.com&quot;

in your case instead of the variable declaration

this line is wrong.
Set Mailer = Server.CreateObject (&quot;SMTPsvg.Mailers&quot;)
the Mailer is not Mailers
should be
Set Mailer = Server.CreateObject(&quot;SMTPsvg.Mailer&quot;)
---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

 
Thanks Onpnt,

Here's the code:

<%
newform = Request.Form(&quot;submit&quot;)
if newform <> &quot;Submit&quot; then
%>

<!-- Onpnt, in this area is my form tag -->

<%
else
mailTo= Request.Form(&quot;mailTo&quot;) & &quot;danielh68@sierratel.com&quot;
Name= Request.Form(&quot;name&quot;)
Title= Request.Form(&quot;title&quot;)
Company= Request.Form(&quot;company&quot;)
Address1= Request.Form(&quot;address1&quot;)
Address2= Request.Form(&quot;address2&quot;)
City= Request.Form(&quot;city&quot;)
State= Request.Form(&quot;state&quot;)
Postal_Code= Request.Form(&quot;postal&quot;)
Country= Request.Form(&quot;countries&quot;)
Telephone= Request.Form(&quot;telephone&quot;)
Ext= Request.Form(&quot;extension&quot;)
Email= Request.Form(&quot;email&quot;)
Website= Request.Form(&quot;website&quot;)
<!-- -->
Set Mailer = Server.CreateObject (&quot;SMTPsvg.Mailer&quot;)
Mailer.FromName = &quot;Tech Support&quot;
Mailer.FromAddress = &quot;danielh68@sierratel.net&quot;
Mailer.Subject = &quot;IDS-3940799 - &quot; & Subject
Mailer.BodyText = &quot;Name: &quot; & Name & vbcrlf
Mailer.BodyText = &quot;Title: &quot; & Title & vbcrlf
Mailer.BodyText = &quot;Company: &quot; & Company & vbcrlf
Mailer.BodyText = &quot;Address1: &quot; & Address1 & vbcrlf
Mailer.BodyText = &quot;Address2: &quot; & Address2 & vbcrlf
Mailer.BodyText = &quot;City: &quot; & City & vbcrlf
Mailer.BodyText = &quot;State: &quot; & State & vbcrlf
Mailer.BodyText = &quot;Postal_Code: &quot; & Postal_Code & vbcrlf
Mailer.BodyText = &quot;Country: &quot; & Country & vbcrlf
Mailer.BodyText = &quot;Telephone: &quot; & Telephone & vbcrlf
Mailer.BodyText = &quot;Ext: &quot; & Ext & vbcrlf
Mailer.BodyText = &quot;Email: &quot; & Email & vbcrlf
Mailer.BodyText = &quot;Website: &quot; & Website & vbcrlf

Mailer.RemoteHost = &quot;mail.blitzdesign.net&quot;

Mailer.AddRecipient &quot;dan&quot;, &quot;danielh68@sierratel.com&quot;

if Mailer.SendMail then
' Message sent sucessfully
response.write &quot;Your message was sent to &quot; & mailTo
else
' Message send failure
response.write &quot;Your message was not sent.<br>&quot;
response.write &quot;The error was: &quot; & Mailer.Response & &quot;<br>&quot;
end if

end if
%>
 
how about we do some debugging. :)
first, get rid of all those Mailer.BodyText and do this
bodytxt = &quot;Name: &quot; & Name & vbcrlf & &quot;Title: &quot; & Title & vbcrlf
bodytxt = bodytxt & &quot;Company: &quot; & Company & vbcrlf & &quot;Address1: &quot; & Address1 & vbcrlf
bodytxt = bodytxt & &quot;Address2: &quot; & Address2 & vbcrlf & &quot;City: &quot; & City & vbcrlf
bodytxt = bodytxt & &quot;State: &quot; & State & vbcrlf & &quot;Postal_Code: &quot; & Postal_Code & vbcrlf
bodytxt = bodytxt & &quot;Country: &quot; & Country & vbcrlf & &quot;Telephone: &quot; & Telephone & vbcrlf
bodytxt = bodytxt & &quot;Ext: &quot; & Ext & vbcrlf & &quot;Email: &quot; & Email & vbcrlf
bodytxt = bodytxt & &quot;Website: &quot; & Website & vbcrlf

then one bodytext
Mailer.BodyText = bodytxt

big reason is it's cleaner and we can test the body text for correct information by writing it to the screen. although I know that is not a error it's a good practice.

Biggy.. I just went to see what it is you posted in the link for supported components and it's AspEmail which is different
so to convert do
<%
Set Mail = Server.CreateObject(&quot;Persits.MailSender&quot;)
Mail.Host = &quot;smtp.smtp-server.com&quot;
you need to know this' Specify a valid SMTP server
which more then likely is just smtp.blitzdesign.net

Mail.From = &quot;danielh68@sierratel.net&quot;
Mail.FromName = &quot;Tech Support&quot;

Mail.AddAddress &quot;danielh68@sierratel.com&quot;, &quot;dan&quot;
Mail.AddReplyTo &quot;danielh68@sierratel.com&quot;

Mail.Subject = &quot;IDS-3940799 - &quot; & Subject
Mail.Body = bodytxt

On Error Resume Next
Mail.Send
If Err <> 0 Then
Response.Write &quot;Error encountered: &quot; & Err.Description
End If
%>
---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

 
Ok, the mailer.RemoteHost was set correctly according to the email above. Anothe rpossible problem is if they went out of their way to specify for you to use your local email account as the from account, it means they may be doing filtering and not passing on messages that don't have have a from address originating on that domain.
I believe RemoteHost is the appropriate method if your using the SMTPsvg.Mailer object, go with onpnts code if you use the Persists.MailSender.

So in this case the .Host should be &quot;mail.blitzdesign.net&quot;.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
No more vacation for me :(

FAQ FAQ20-2863
= new Forums.Posting.General.GettingAnswers()
 
Thanks for your help everyone.

Here's the code again with Onpnt's suggestions. I tried both smtp.blitzdesign.net and mail.blitzdesign.net. Here's the error I received:
Code:
<%
' else send the email
else
mailTo= Request.Form(&quot;mailTo&quot;) & &quot;danielh68@sierratel.com&quot;
Name= Request.Form(&quot;name&quot;)
Title= Request.Form(&quot;title&quot;)
Company= Request.Form(&quot;company&quot;)
Address1= Request.Form(&quot;address1&quot;)
Address2= Request.Form(&quot;address2&quot;)
City= Request.Form(&quot;city&quot;)
State= Request.Form(&quot;state&quot;)
Postal_Code= Request.Form(&quot;postal&quot;)
Country= Request.Form(&quot;countries&quot;)
Telephone= Request.Form(&quot;telephone&quot;)
Ext= Request.Form(&quot;extension&quot;)
Email= Request.Form(&quot;email&quot;)
Website= Request.Form(&quot;website&quot;)

Set Mail = Server.CreateObject(&quot;Persits.MailSender&quot;)
Mail.Host = &quot;mail.blitzdesign.net&quot;
Mail.From = &quot;admin@blitzdesign.net&quot;
Mail.FromName = &quot;Just a test&quot;
Mail.Subject = &quot;Just a test&quot; & Subject
bodytxt = &quot;Name: &quot; & Name & vbcrlf & &quot;Title: &quot; & Title & vbcrlf
bodytxt = &quot;Company: &quot; & Company & vbcrlf & &quot;Address1: &quot; & Address1 & vbcrlf
bodytxt = bodytxt & &quot;Address2: &quot; & Address2 & vbcrlf & &quot;City: &quot; & City & vbcrlf
bodytxt = bodytxt & &quot;State: &quot; & State & vbcrlf & &quot;Postal_Code: &quot; & Postal_Code & vbcrlf
bodytxt = bodytxt & &quot;Country: &quot; & Country & vbcrlf & &quot;Telephone: &quot; & Telephone & vbcrlf
bodytxt = bodytxt & &quot;Ext: &quot; & Ext & vbcrlf & &quot;Email: &quot; & Email & vbcrlf
bodytxt = bodytxt & &quot;Website: &quot; & Website & vbcrlf

Mailer.BodyText = bodytxt
<!-- This condenses everything into one value, correct? -->

Mailer.RemoteHost = &quot;mail.blitzdesign.net&quot;

Mailer.AddRecipient &quot;dan&quot;, &quot;danielh68@sierratel.com&quot;

if Mailer.SendMail then
' Message sent sucessfully
response.write &quot;Your message was sent to &quot; & mailTo
else
' Message send failure
response.write &quot;Your message was not sent.<br>&quot;
response.write &quot;The error was: &quot; & Mailer.Response & &quot;<br>&quot;
end if

end if
%>
 
only one thing is backwards
Set Mail = Server.CreateObject(&quot;Persits.MailSender&quot;)
with mailer. needs to be
Set Mailer = Server.CreateObject (&quot;SMTPsvg.Mailer&quot;)
else use the exapmle I showed in the end of my other post using the AspEmail component. check tarwn's post for the differences with the addition of AspMail from mine.
that is why you are getting the Mailer error


---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

 
Thanks everyone. It's working now. Sorry I didn't respond earlier because I still had problems of a different nature. Syntax problems. Anyhow, much appreciation for your expertise!

--DanH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top