Jump to content

ASP Email system


jimbo1978

Recommended Posts

Hi all,I am looking to create a form that allows a user to input some information and then submit the form as an email request. I was wondering how should go about geting this setup, looking at the tutorials page it mentions CDOSYS object that can be used to handle this. Is this correct or should I be doing it another way? Thanks for your help.RegardsJames

Link to comment
Share on other sites

nope that is the way to do it. Just liek the tuorial says http://www.w3schools.com/asp/asp_send_email.asp
Hi there,I have tried his way and I have just kept it as pure HTML and used the FORM action. When using the FORM I have entered the following:<form action="mailto:email account address">and I receive an email messageHowever when using the code given on the ASP CDO tutorial the script appears to be processing without errors as it loads a blank page but I am receiving no email. I havent made any changes to the code provided other than the email addresses as I wanted to see how it works before adjusting it. This is what I have as a asp file called createMail.asp.<html><body><%dim myMailSet myMail=CreateObject("CDO.Message")myMail.Subject="Sending email with CDO"myMail.From="james.mulcahy@vivista.sungard.com"myMail.To="mailto:james.mulcahy@vivista.sungard.com"myMail.TextBody="This is a message."myMail.Sendset myMail=nothing%></body></html> Thanks again for your helpJames
Link to comment
Share on other sites

<%dim myMailSet myMail=CreateObject("CDO.Message")myMail.Subject="Sending email with CDO"myMail.From="james.mulcahy@vivista.sungard.com"myMail.To="mailto:james.mulcahy@vivista.sungard.com"myMail.TextBody="This is a message."myMail.Sendset myMail=nothing%>
If I use this code, do I need a database or anything then, or do I only need a mail? And one more thing...I don't want it to say those things you've written, how do I make the form after this form and how do I for example the a input called TextBody will be the body of the mail?
Link to comment
Share on other sites

I can't make it work for some reason :SYou couldn't like...give the code with an email to anders_sm@hotmail.com instead of the other one? With the form too?
I have copied in the code you supplied aspguy, however it is still not working. Not sure what Im doing wrong. It processes the form but nothing is coming into the email address, is it because I am on an Exchange server. Would I need to include the SMTP address?James
Link to comment
Share on other sites

I have copied in the code you supplied aspguy, however it is still not working. Not sure what Im doing wrong. It processes the form but nothing is coming into the email address, is it because I am on an Exchange server. Would I need to include the SMTP address?James
Below is the html form, at the moment it is very basic just wanted to get it working.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html> <head> <title>Title</title> </head> <body> <form method="post" action="http://localhost/web/createEmail.asp" > Company Name: <input type="text" name="cname"> <br> Address Line 1: <input type="text" name="address1"> <br> <input type="submit" value="Submit"> </form> </body></html>Below is the ASP file, ideally I would like the email text body to include the data attributes within some form email template:<html><body><%dim myMailSet myMail=CreateObject("CDO.Message")myMail.Subject="Sending email with CDO"myMail.From="james.mulcahy@vivista.sungard.com"myMail.To="mailto:james.mulcahy@vivista.sungard.com"myMail.TextBody="This is a message."myMail.Sendset myMail=nothing%></body></html>
Link to comment
Share on other sites

The To address should not have mailto: at the beginning of it, it should just be the address.
I have taken out the mailto at the beginning but still nothing coming through, on the tutorials it mentions when using a remote server it would need an SMTP address etc. If the mailbox Im using is via an Exchange server would I have to obtain the SMTP address for the exchange server?
Link to comment
Share on other sites

I'm going to make the same comment I've been making about sending mail from your site, check with your ISP.See if your ISP offers a form mail integration guide. If the ISP's support is thorough at all they should have a snippet posted in their online support that details how to do this.Some ISP's don't even allow CDO, having replaced it with some other comparable component.Here's an example from the MSDN:http://msdn2.microsoft.com/en-us/library/ms873694.aspxif you read this example on MSDN, pay attention to the cdo.configuration object, this is used to provide authentication credentials to the mail server and is likely required by your ISP if they are using CDO / Exchange.also in this case, the 'from' address is usually going to have to be a real email address, registered to the domain name you're trying to send from.

Link to comment
Share on other sites

I have taken out the mailto at the beginning but still nothing coming through, on the tutorials it mentions when using a remote server it would need an SMTP address etc. If the mailbox Im using is via an Exchange server would I have to obtain the SMTP address for the exchange server?
If you are sending using a remote server, then yes, you need the address of the mail server you are sending through. It would be the Exchange server only if you are sending through the Exchange server's email server, but not if Exchange is only being used for the email inboxes. If you leave out the email server (like in your code), then it attempts to connect to an email server running on the web server. Also, you have your form action set to localhost, so that will only work if you are running the page from the web server itself. It will not work if you are browsing on a computer other then the actual web server.
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...