ASP Hosting sale!
Double disk space and transfer for FREE!
Limited time offer! Act Now!

aspdev | articles | tutorials | forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

cdosys autoresponder

 
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming
View previous topic :: View next topic  
Author Message
marqwest



Joined: 24 Feb 2005
Posts: 1

PostPosted: Thu Feb 24, 2005 12:56 pm    Post subject: cdosys autoresponder Reply with quote

asp newbie ..

I need to set up an autoresponder when a user fills out my web form. 1 email going to user with thank you information and the other sent to me with the form fields information. This is my existing code..

<%
'Dimension variables
Dim objCDOSYSCon


'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")


'Out going SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.clovertech.com"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objCDOSYSCon.Fields.Update

'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon


objCDOSYSMail.From = request("email")
objCDOSYSMail.To = "info@clovertech.com"
objCDOSYSMail.Subject = "Clover Tech Web Form Submission"
objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody &"<br>Business Name: " & request("Business")
objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody &"<br>Name: " & request("Name")
objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody &"<br>Email: " & request("email")
objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody &"<br>Title: " & request("Title")
objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody &"<br>Address: " & request("Address")
objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody &"<br>City: " & request("City")
objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody &"<br>State: " & request("State")
objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody &"<br>Zip: " & request("postCode")
objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody &"<br>Business Phone: " & request("tel")
objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody &"<br>Will you purchase compatible cartridges for:" & request("check1")
objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody &"<br>Have you purchased compatible products in the past? " & request("check2")
objCDOSYSMail.HTMLBody = objCDOSYSMail.HTMLBody &"<br>Comments: " & request("comments")

objCDOSYSMail.Send


'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
%>
Back to top
View user's profile Send private message
administrator
Site Admin


Joined: 01 Oct 2004
Posts: 183

PostPosted: Thu Feb 24, 2005 4:57 pm    Post subject: Reply with quote

Welcome to our forums Very Happy

Your code looks good, the only thing I would change is the from line:

objCDOSYSMail.From = request("email")

Instead of request("email") use "info@clovertech.com".
The reason for this is because some email servers don't allow sending an email from a different domain than the one that your application is running from.

As for the second "thank you" email sent to the user, just create a new CDOSYS object and use it to send whatever you want to the user...

Let me know if you have any questions.



Thanks,
_________________
Peter
ASP & ASP.NET Articles and Tutorials
Back to top
View user's profile Send private message
jadranko



Joined: 11 Mar 2005
Posts: 1

PostPosted: Fri Mar 11, 2005 6:52 pm    Post subject: how secure is objCDOSYSMail? Reply with quote

I am thinking of using some code found on http://www.toddwoolums.com/asplogin.asp

that uses objCDOSYSMail for mailing users to activate their accounts. My question would be: how secure is is this method for emailing? In particular I am concerned with hackers being able to impersonate the sender for mass mailings.

Thanks in advance for any help you could give me. The code to be used is below:

Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = vEmailServer
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objCDOSYSCon.Fields.Update
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = vSiteEmail
objCDOSYSMail.To = strEmail
objCDOSYSMail.Subject = "New Account"
objCDOSYSMail.HTMLBody = htmlBody
objCDOSYSMail.Send
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
Back to top
View user's profile Send private message MSN Messenger
administrator
Site Admin


Joined: 01 Oct 2004
Posts: 183

PostPosted: Fri Mar 11, 2005 11:52 pm    Post subject: Reply with quote

You can make it secure, by adding a password to your ASP page that sends the email. If this is a new user registration/activation, just send the password along with the form information to the page that sends the email. In the beginning of the ASP page that sends the email, check if the password has been submitted, and if not send a error message to the browser and don't send the email.

Let me know if you have any questions.


Cheers,
_________________
Peter
ASP & ASP.NET Articles and Tutorials
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group

SQL Tutorial