Jump to content

codsys


steveaj

Recommended Posts

the example below describes how one can send email with cdosys;<%Set myMail=CreateObject("CDO.Message")myMail.Subject="Sending email with CDO"myMail.From="mymail@mydomain.com"myMail.To="someone@somedomain.com"myMail.TextBody="This is a message."myMail.Sendset myMail=nothing%>will it work when the myail.To field contains something like; request.form("eadress").Now what I am trying to ask is that; in the form, you already have a field where the visitor should input his email address and and the name of the field according to how I design it is "eadress", it is intended that as soon as he submit his form an email should be sent to his email address, will it work if you do it the way I described above? If not what is the alternative method? I wrote the above code in the form action (the page the form is going to be submitted to) and I substituted the myMail.To field with what I described but I don't know if its going to work since i have not published itI thank all those who used to contribute to my questions. People like aspnetguy, just some guys etc. I love you all.Steve

Link to comment
Share on other sites

It will work as long as the form variable contains a valid address. You don't need to have a constant string (a quoted string) for the To property, it can be a variable also. A variable is something that comes out of Request (those are predefined variables), or maybe out of a database, or just a variable that you define yourself.So, as long as the variable that you assign to the To property contains a valid address, the mail will be sent. The mail will still try to send even if there is an invalid address, but I'm not sure if you will see an ASP error or if the mail server will just silently trash it.Steve

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...