send email message with asp
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS and SMTP > send email message with asp




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    send email message with asp  
shaggy


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-27-04 06:34 AM

I am asking for help from someone who has created an asp page that uses STMP
to send an email message from WinXP Pro/IIS 5.  I tried nearly a dozen
examples (including a great one here http://www.sitepoint.com/article/1139 )
but with no luck.

As explained/predicted on many IIS sites - i get a script error when i try
to use CDONTS with WinXP.  I did not find anything on TechNet, MSDN or KB
sites that was helpful.  Some sites suggest CDOSYS in place of CDONTS but I
did not find an example that works.

I would also be interested in how to make it work on Win Server 2003 as I am
contemplating that "upgrade".  I would rather not use a 3rd-party-type
emailer component.

Thanks in advance for any info.









[ Post a follow-up to this message ]



    Re: send email message with asp  
Jeff Cochran


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-27-04 03:34 PM

On Thu, 26 Feb 2004 22:07:27 -0800, "shaggy" <jimav3@hotmail.com>
wrote:

>I am asking for help from someone who has created an asp page that uses STM
P
>to send an email message from WinXP Pro/IIS 5.  I tried nearly a dozen
>examples (including a great one here http://www.sitepoint.com/article/1139 
)
>but with no luck.

See:

http://www.aspfaq.com/show.asp?id=2119

>As explained/predicted on many IIS sites - i get a script error when i try
>to use CDONTS with WinXP.  I did not find anything on TechNet, MSDN or KB
>sites that was helpful.

CDONTS isn't in XP.  Kinda causes errors when you try to use it.  Use
CDO.SYS.

>Some sites suggest CDOSYS in place of CDONTS but I
>did not find an example that works.

This one works:

http://www.aspfaq.com/show.asp?id=2026

And:

http://www.aspfaq.com/show.asp?id=2339

>I would also be interested in how to make it work on Win Server 2003 as I a
m
>contemplating that "upgrade".  I would rather not use a 3rd-party-type
>emailer component.

Any of the above work.

But, here's the real issue you face:

You are having a problem when using the CDO method.  You tell us it
"didn't work".  If I told you I had a problem with my car and it
didn't work, would you have the solution readily available?

Post the problem you're having, including specific error messages,
expected and actual results, log entires, event log entries and code
snippets to the ASP group.  With that information, someone might be
able to do more than point you to FAQ's.  Or at least point you to the
correct FAQ.

By the way, my car didn't work because my wife had the keys.  Did my
explanation lead you to that conclusion?

Jeff





[ Post a follow-up to this message ]



    Re: send email message with asp  
shaggy


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-27-04 10:34 PM

Here are the specifics on my issue.  When I submit the form the following er
ror is displayed:

Error Type:
(0x8004020F)
The event class for this subscription is in an invalid partition
/picks/tuessendmail.asp, line 100

My line 100 reads: objMail.Send

Below is my entire asp page - based on the example at http://www.sitepoint.com/art
icle/1139:

<!--METADATA TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library" --><!--METADATA TYPE="typelib"
UUID="00000205-0000-0010-8000-00AA006D2EA4"
NAME="ADODB Type Library" --><%
'EMAIL FORM USING CLASSIC ASP AND CDONTS
Dim varName, varEmail, varCompany, varTelephone, varComments, varSend, thisP
age
varName  = Request.Form("txtName")
varEmail  = Request.Form("txtEmail")
varCompany  = Request.Form("txtCompany")
varTelephone  = Request.Form("txtPhone")
varComments  = Request.Form("txtComments")
varSend  = Request.Form("send")
thisPage  = Request.ServerVariables("SCRIPT_NAME")

If not varSend = 1 Then
'OUTPUT THE CONTACT FORM
%><form action="<%= thisPage %>" method="post"><input type="hidden" name="se
nd" value="1"><p>Feel free to contact us using this web form</p><p>&nbsp
;</p><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr vali
gn="top"><td align="right">Name
:</td><td width="3%">&nbsp;</td><td nowrap><input type="text" name="txtN
ame" size="35"></td></tr><tr valign="top"><td align="right">Company:</td><td
 width="3%">&nbsp;</td><td><input type="text" name="txtCompany" size="35
"></td></tr><tr valign="top"><td al
ign="right">email:</td><td width="3%">&nbsp;</td><td nowrap><input type=
"text" name="txtEmail" size="35"></td></tr><tr valign="top"><td align="right
">Telephone:</td><td width="3%">&nbsp;</td><td><input type="text" name="
txtPhone" size="25"></td></tr><tr v
align="top"><td align="right">Comments:</td><td width="3%">&nbsp;</td><t
d><textarea name="txtComments" rows="5"
cols="35"></textarea></td></tr><tr valign="top"><td align="right">&nbsp;
</td><td width="3%">&nbsp;</td><td>&nbsp;</td></tr><tr valign="top">
<td align="right"><input type="submit"
name="Submit" value="Submit"></td><td width="3%">&nbsp;</td><td><input t
ype="reset" name="Reset"
value="Reset" class="frm"></td></tr></table></form><%
Else

'SEND MAIL AND OUTPUT THANK YOU RESPONSE

'REPLACE LINE RETURNS WITH HTML BREAKS
varComments = Replace(varComments, chr(10), "<br />")

'THE MAIL OBJECT
Dim ObjMail
Set ObjMail = Server.CreateObject("CDO.Message")

Set objConfig = CreateObject("CDO.Configuration")

'Configuration:
objConfig.Fields(cdoSendUsingMethod) = cdoSendUsingPort
objConfig.Fields(cdoSMTPServer) = "localhost"
objConfig.Fields(cdoSMTPServerPort) = 25
objConfig.Fields(cdoSMTPAuthenticate) = cdoBasic

'Update configuration
objConfig.Fields.Update
Set objMail.Configuration = objConfig

objMail.From = varName & " <" & varEmail & ">"
objMail.To = "jimav3@hotmail.com" 'Add your email address
objMail.Subject = "Contact from Your Website"
objMail.HTMLBody = varName & "<br />"_
& VBCrLf & varCompany & "<br />"_
& VBCrLf & varTelephone & "<br />"_
& CBCrLf & varComments & "<br />"
objMail.Send

Set objMail = Nothing
Set objConfig = Nothing

'AND OUTPUT THANK YOU

Response.Write "Hey "& varName & ",<br />"_
& VBCrLf & "Thanks for your feedback.<br />"_
& VBCrLf & "We’ll contact you as soon as possible!"

End If

%>



----- Jeff Cochran wrote: -----

On Thu, 26 Feb 2004 22:07:27 -0800, "shaggy" <jimav3@hotmail.com>
wrote:

>I am asking for help from someone who has created an asp page that uses STM
P
>to send an email message from WinXP Pro/IIS 5.  I tried nearly a dozen
>examples (including a great one here http://www.sitepoint.com/article/1139 
)
>but with no luck.

See:

http://www.aspfaq.com/show.asp?id=2119

>As explained/predicted on many IIS sites - i get a script error when i try
>to use CDONTS with WinXP.  I did not find anything on TechNet, MSDN or KB
>sites that was helpful.

CDONTS isn't in XP.  Kinda causes errors when you try to use it.  Use
CDO.SYS.

>Some sites suggest CDOSYS in place of CDONTS but I
>did not find an example that works.

This one works:

http://www.aspfaq.com/show.asp?id=2026

And:

http://www.aspfaq.com/show.asp?id=2339

>I would also be interested in how to make it work on Win Server 2003 as I a
m
>contemplating that "upgrade".  I would rather not use a 3rd-party-type
>emailer component.

Any of the above work.

But, here's the real issue you face:

You are having a problem when using the CDO method.  You tell us it
"didn't work".  If I told you I had a problem with my car and it
didn't work, would you have the solution readily available?

Post the problem you're having, including specific error messages,
expected and actual results, log entires, event log entries and code
snippets to the ASP group.  With that information, someone might be
able to do more than point you to FAQ's.  Or at least point you to the
correct FAQ.

By the way, my car didn't work because my wife had the keys.  Did my
explanation lead you to that conclusion?

Jeff






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:49 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register