<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Migrating from ASP to ASP.NET</title><link>http://forums.asp.net/29.aspx</link><description>Discuss moving from classic ASP to ASP.NET. </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Sending email using CDO</title><link>http://forums.asp.net/thread/3159445.aspx</link><pubDate>Wed, 13 May 2009 10:15:26 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3159445</guid><dc:creator>matthisco</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3159445.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=29&amp;PostID=3159445</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Thanks for you reply, I have this working now. However, do you know how I can guard against spam?&lt;br /&gt;&lt;br /&gt;My code is below, thankyou again&lt;br /&gt;&lt;br /&gt;&amp;lt;%&lt;br /&gt;&lt;br /&gt;Sub sendEmail(mailFrom, mailTo, mailSubject, mailMessage, mailServer)&lt;br /&gt;Set MyMail = CreateObject(&amp;quot;cdo.message&amp;quot;)&lt;br /&gt;MyMail.From = mailFrom&lt;br /&gt;MyMail.To = mailTo&lt;br /&gt;MyMail.Subject = mailSubject&lt;br /&gt;MyMail.HTMLBody = mailMessage&lt;br /&gt;MyMail.Configuration.Fields.Item(&amp;quot;http://schemas.microsoft.com/cdo/configuration/smtpserver&amp;quot;) = mailServer&lt;br /&gt;MyMail.Configuration.Fields.Update&lt;br /&gt;MyMail.Send&lt;br /&gt;Set MyMail = nothing&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Dim mailFrom, mailTo, mailSubject, mailMessage, mailServer&lt;br /&gt;&lt;br /&gt;mailFrom = &amp;quot;xx@xx.nhs.uk&amp;quot;&lt;br /&gt;mailTo = &amp;quot;xxx@xx.co.uk&amp;quot;&lt;br /&gt;mailSubject = &amp;quot;This is my subject&amp;quot;&lt;br /&gt;mailMessage = &amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;This is my message&amp;lt;/body&amp;gt;&amp;lt;html&amp;gt;&amp;quot;&lt;br /&gt;mailServer = &amp;quot;smtp.fasthosts.co.uk&amp;quot;&lt;br /&gt;&lt;br /&gt;Call sendEmail(mailFrom, mailTo, mailSubject, mailMessage, mailServer)&lt;br /&gt;%&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Sending email using CDO</title><link>http://forums.asp.net/thread/3157401.aspx</link><pubDate>Tue, 12 May 2009 11:40:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3157401</guid><dc:creator>qwe123kids</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3157401.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=29&amp;PostID=3157401</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;//Mail code U look the link below&lt;br /&gt;&lt;/p&gt;&lt;p&gt;http://support.jodohost.com/showthread.php?p=52440&lt;/p&gt;&lt;p&gt;&amp;nbsp;Reason for error may The SMTP server may Be rejecting the Mail or More Information Check the below link&lt;br /&gt;&lt;/p&gt;&lt;p&gt;http://classicasp.aspfaq.com/email/why-does-cdo-message-give-me-8004020f-errors.html &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Check the above link &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;</description></item><item><title>Sending email using CDO</title><link>http://forums.asp.net/thread/3157354.aspx</link><pubDate>Tue, 12 May 2009 11:15:17 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3157354</guid><dc:creator>matthisco</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3157354.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=29&amp;PostID=3157354</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi, Sorry if this is the wrong forum.&lt;/p&gt;&lt;p&gt;I&amp;#39;m trying to send an email uding CDO. Can anyone please help?&lt;/p&gt;&lt;p&gt;&amp;nbsp;form ---------------------&lt;/p&gt;&lt;p&gt;&amp;lt;form action=&amp;quot;mail.asp&amp;quot; method=&amp;quot;post&amp;quot; name=&amp;quot;mailform&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;input name=&amp;quot;email&amp;quot; type=&amp;quot;text&amp;quot; size=&amp;quot;40&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;input name=&amp;quot;email_submit&amp;quot; type=&amp;quot;submit&amp;quot;&lt;br /&gt;value=&amp;quot;sendmail&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;/p&gt;&lt;p&gt;code----------------------------&lt;/p&gt;&lt;p&gt;&amp;lt;%&lt;br /&gt;dim oCdoMsg, oCdoConfg, strReferer, strServer, strClientIP, strServerIP, blnSpam&lt;br /&gt;&lt;br /&gt;set oCdoMsg = server.createobject(&amp;quot;CDO.Message&amp;quot;)&lt;br /&gt;&lt;br /&gt;strReferer = request.servervariables(&amp;quot;HTTP_REFERER&amp;quot;)&lt;br /&gt;strServer = Replace(request.servervariables(&amp;quot;SERVER_NAME&amp;quot;), &amp;quot;www.&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;strClientIP = request.servervariables(&amp;quot;REMOTE_ADDR&amp;quot;)&lt;br /&gt;strServerIP = request.servervariables(&amp;quot;LOCAL_ADDR&amp;quot;)&lt;br /&gt;strFrom = &amp;quot;noreply@&amp;quot; &amp;amp; strServer&lt;br /&gt;&lt;br /&gt;intComp = inStr(strReferer, strServer)&lt;br /&gt;If intComp &amp;gt; 0 Then&lt;br /&gt;blnSpam = False&lt;br /&gt;Else&lt;br /&gt;&amp;#39; Spam Attempt Block&lt;br /&gt;blnSpam = True&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;oCdoMsg.to = request.form(&amp;quot;email&amp;quot;)&lt;br /&gt;oCdoMsg.from = strFrom&lt;br /&gt;oCdoMsg.Subject = &amp;quot;CDO Test Mail&amp;quot;&lt;br /&gt;oCdoMsg.Textbody = &amp;quot;This test mail has been sent from server &amp;quot;&lt;br /&gt;oCdoMsg.Textbody = oCdoMsg.Textbody &amp;amp; request.servervariables(&amp;quot;LOCAL_ADDR&amp;quot;) &amp;amp; &amp;quot; via CDO mail objects.&amp;quot;&lt;br /&gt;&lt;br /&gt;strMSSchema = &amp;quot;http://schemas.microsoft.com/cdo/configuration/&amp;quot;&lt;br /&gt;Set oCdoConfg = Server.CreateObject(&amp;quot;CDO.Configuration&amp;quot;)&lt;br /&gt;oCdoConfg.Fields.Item(strMSSchema &amp;amp; &amp;quot;sendusing&amp;quot;) = 2&lt;br /&gt;oCdoConfg.Fields.Item(strMSSchema &amp;amp; &amp;quot;smtpserver&amp;quot;) = &amp;quot;smtp.fasthosts.co.uk&amp;quot;&lt;br /&gt;oCdoConfg.Fields.Update&lt;br /&gt;Set oCdoMsg.Configuration = oCdoConfg&lt;br /&gt;&lt;br /&gt;If NOT blnSpam Then&lt;br /&gt;oCdoMsg.send&lt;br /&gt;strResult = &amp;quot;Mail Sent.&amp;quot;&lt;br /&gt;Else&lt;br /&gt;strResult = &amp;quot;Mail Not Sent.&amp;quot;&lt;br /&gt;End If&lt;br /&gt;response.write strResult&lt;br /&gt;&lt;br /&gt;set oCdoMsg = nothing&lt;br /&gt;set oCdoConfg = nothing&lt;br /&gt;&lt;br /&gt;%&amp;gt;&lt;br /&gt;&lt;br /&gt;error:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;font size="2" face="Arial"&gt;error &amp;#39;8004020f&amp;#39;&lt;/font&gt;
&lt;/p&gt;&lt;p&gt;
&lt;font size="2" face="Arial"&gt;/mail.asp&lt;/font&gt;&lt;font size="2" face="Arial"&gt;, line 35&lt;/font&gt; &lt;/p&gt;</description></item></channel></rss>