• 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.
  • Posts

    • ah yes, the person who thinks Bill Gates is a plant for Monsanto........
    • Meta announces 20-year nuclear energy partnership to support its data centres by Fiza Ali Meta announced a 20-year partnership with Constellation Energy today to secure nuclear power from the Clinton Clean Energy Center, reinforcing its commitment to clean energy for its data centre operations. Meta’s data centres lie at the heart of its global operations, powering everything from social media platforms to artificial intelligence technologies. As demand for AI accelerates, these facilities require vast and consistent amounts of electricity to maintain performance, reliability, and uptime. Meta currently matches its electricity consumption with 100% clean and renewable energy. As energy demands increase, particularly due to the growth of AI workloads, the company is incorporating additional energy sources such as nuclear power to maintain a consistent supply. Under the agreement, which begins in 2027, Meta will purchase 1,121 megawatts of emissions-free nuclear electricity from the Clinton plant in Illinois. The deal includes an additional 30 megawatts of capacity to the local grid and will help maintain the long-term operation of the facility without relying on state subsidies. It also supports over 1,100 local jobs and contributes $13.5 million annually in tax revenue. In parallel with the Constellation agreement, Meta is progressing its previously announced Request for Proposals (RFP) for new nuclear capacity. Since the RFP was launched early this year, the company has received more than 50 qualified submissions from utilities, developers, and nuclear-technology manufacturers spanning over 20 states. Meta has shortlisted several projects with the aim of developing between 1 and 4 gigawatts of new nuclear capacity. These projects are intended to accelerate development where execution is feasible and timelines are clear. Through both the Constellation agreement and its ongoing RFP process, Meta is positioning nuclear energy as a key component of its long-term energy strategy. This approach forms part of the company's "Tripling Nuclear Pledge," through which it aims to amplify the market for nuclear power in the United States.
  • Recent Achievements

    • Week One Done
      jrromero17 earned a badge
      Week One Done
    • One Month Later
      jrromero17 earned a badge
      One Month Later
    • Conversation Starter
      johnwin1 earned a badge
      Conversation Starter
    • One Month Later
      Marwin earned a badge
      One Month Later
    • One Year In
      fred8615 earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      223
    2. 2
      snowy owl
      156
    3. 3
      ATLien_0
      135
    4. 4
      Xenon
      127
    5. 5
      +FloatingFatMan
      125
  • Tell a friend

    Love Neowin? Tell a friend!