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

Will SMTPsvg send mail without CDONTS

Status
Not open for further replies.

DSect

Programmer
Sep 3, 2001
191
US
SMTPsvg

I've seen a few pages using this thing to send mail from ASPages, instead of CDONTS.

I want to send mail using ASP, but I do not have a local server.. Only a remote one.

Will this work?

Here's some examples:


<%
DIM HTML
HTML = &quot;<html><head><title>&quot;ASPMail Sample&quot;</title><meta http-equiv=&quot;&quot;Content-Type&quot;&quot; content=&quot;&quot;text/html; charset=iso-8859-1&quot;&quot;>&quot; & vbCrLf
HTML = HTML & &quot;</head><body bgcolor=#FFFFFF><table width=640 border=0 cellspacing=0 cellpadding=4>&quot; & vbCrLf
HTML = HTML & &quot;<tr><td><img src=&quot;&quot; & vbCrLf
HTML = HTML & &quot;<tr><td bgcolor=#666699><b><font style=&quot;&quot;font-family:Verdana, sans-serif&quot;&quot; size=4 color=#FFFFFF>Ask the Junkie Confirmation</font></b></td></tr>&quot; & vbCrLf
HTML = HTML & &quot;<tr><td><font style=&quot;&quot;font-family:Verdana, sans-serif&quot;&quot; size=2>&quot; & vbCrLf
HTML = HTML & &quot;<p> Your question has been submitted to <b>Ask the Junkie</b>. &quot; & vbCrLf
HTML = HTML & &quot;We will reply with an answer as soon as we can, based on the volume of questions &quot; & vbCrLf
HTML = HTML & &quot;coming in at this time. If we chose your question for publication, you will be notified &quot; & vbCrLf
HTML = HTML & &quot;via e-mail.</p><p>Thank you,</p><p>&quot; & vbCrLf
HTML = HTML & &quot;<a href=&quot;&quot; | &quot;
HTML = HTML & &quot;<a href=&quot;&quot;ASPNextGen.com&quot;&quot;>ASPNextGen.com</a></p></font>&quot; & vbCrLf
HTML = HTML & &quot;</td></tr></table></body></html>&quot;

'DEFINE VARIABLES FOR ASPEMAIL
DIM Mailer
SET Mailer = Server.CreateObject(&quot;SMTPsvg.Mailer&quot;)
Mailer.FromName = &quot;ASPNextGen.com&quot;
Mailer.FromAddress= &quot;askthejunkie@ASPNextGen.com&quot;
Mailer.RemoteHost = &quot;mail.server.com&quot;
Mailer.AddRecipient &quot;askthejunkie&quot;, &quot;doug.seven@codejunkies.net&quot;
Mailer.AddCC &quot;Darkside&quot;, &quot;darkside103@hotmail.com&quot;
Mailer.Subject = &quot;Ask the Junkie Confirmation&quot;
Mailer.ContentType = &quot;text/html&quot;
Mailer.BodyText = HTML
Mailer.Priority = 2

'If the email fails, prompt the user to click back and try again
IF Mailer.SendMail THEN
Response.Redirect(&quot;askjunkie.asp?mode=2&quot;)
ELSE
Response.Redirect(&quot;askjunkie.asp?mode=3&quot;)
END IF


Think I need anything else, besides IIS and a remote SMTP server?

Thx!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top