• 0

form to email (SMTP) script for IIS


Question

2 answers to this question

Recommended Posts

  • 0

http://www.toaststudios.com/magicemail.zip

I wrote an ASP script called magicmail.asp that does what you are needing. The only limitation is that it uses ADISCON SimpleMail component to send the mail. You can get a shareware version of the component over at:

http://www.adiscon.com/en/

It shouldn't be hard to configure it to work with another mail component (such as JMail or CDONTS).

Here is how you use it:

You build your form and make sure you name all your form objects.

Then you add the following "hidden" input types:

"to_email" | the address that the form will be mailed too

"number_of_items" | the number of items that will be included in the email.

"from_email" | the from address that will be attatched to the email

"subject_email" | the subject of the email

"title" | the header of the email

"items" : (this is kind of confusing so read carefully)

the value of this hidden field can take on the form of:

"item1, item2, item3, item4..." so each item is seperated by a comma (where an item is the NAME of each field that will be submitted in the email)

or it can also take the form:

"Catagory Name: item1, item2, item3 | Catagory2 Name: item4, item5, item6 | Catagory3 Name: item7, item8" and so forth.

I found a need to be able to seperate different items into catagories and this is how I decided to do it. My script is pretty picky on the spacing :( (i'll fix that in the next version).

The last hidden field is:

"redirect_to" | this is the URL that the user will goto after submitting the information.

Here is an example of an html form that uses magicemail.asp:

---------------------------------------------

This is a test of magicemail.asp

Personal Information

Name:

Address:

E-Mail Address:

Additional Information

More Information:

Even More Information:

---------------------------------------------------

I also made the email pretty custimizable. If you crack open magicemail.asp in notepad and scroll down to the"Stylization:" comment it should be pretty straight forward on how to fix the HTML the way you want so that the email looks the way you want.

if you have any questions don't hesitate to PM me ! :)

-Nic

  • 0

If you have the CDO NTS library installed, it's as simple as creating an object:

Set oMail = Server.CreateObject("CDONTS.NewMail")

oMail.To = "me@msn.com"

oMail.From = "you@msn.com"

oMail.Subject = "Hi!"

oMail.Body = "Test email, 1,2,3"

oMail.Send

Set oMail = Nothing.

Go here to learn more from MSDN.

Or download the FREE .Net framework and use the email features available from ASP.Net. Learn about that here.

Any other questions, feel free to email me.

intentionallyu@msn.com

iUk

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.