14
Smart Mailer ASP Tutorials Smart Mailer ASP Tutorials Smart Mailer - Send mail to one recipient ................................................................................................1 How do you send mail to one recipient when form is submitted? .......................................................1 How to do it ...............................................................................................................................................1 Smart Mailer - Send mail to multiple recipients.......................................................................................5 How do you send mail to multiple recipients when form is submitted................................................5 How to do it ...............................................................................................................................................5 Smart Mailer - Send mail with attachment from list ...............................................................................8 How do you send mail to one recipient with an attachment from list .................................................8 How to do it ...............................................................................................................................................9 Smart Mailer - Send mail with attachment from recordset ..................................................................11 How do you send mail to one recipient with an attachment ...............................................................11 How to do it .............................................................................................................................................11 Smart Mailer - Send mail to one recipient How do you send mail to one recipient when form is submitted? You created a simple contact us form and would like to have the results of the form emailed to you. In this tutorial we will create a simple contact form and when the user submits the form results will be mailed to you. How to do it 1. Open page Open your asp file that will display the contact form. I have created a form with the following fields: Name, Company, Email, Question/Concern. Copyright © 2003 DMXzone.com All Rights Reserved to get more go to DMXzone.com Page 1 of 14

Smart Mailer ASP Tutorials - DMXzone€¦ · Smart Mailer ASP Tutorials 2. Create your variables To be able to email the content of the form, you need to create variables for the

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Smart Mailer ASP Tutorials - DMXzone€¦ · Smart Mailer ASP Tutorials 2. Create your variables To be able to email the content of the form, you need to create variables for the

Smart Mailer ASP Tutorials

Smart Mailer ASP Tutorials Smart Mailer - Send mail to one recipient ................................................................................................1

How do you send mail to one recipient when form is submitted? .......................................................1 How to do it ...............................................................................................................................................1

Smart Mailer - Send mail to multiple recipients.......................................................................................5 How do you send mail to multiple recipients when form is submitted................................................5 How to do it ...............................................................................................................................................5

Smart Mailer - Send mail with attachment from list ...............................................................................8 How do you send mail to one recipient with an attachment from list .................................................8 How to do it ...............................................................................................................................................9

Smart Mailer - Send mail with attachment from recordset ..................................................................11 How do you send mail to one recipient with an attachment...............................................................11 How to do it .............................................................................................................................................11

Smart Mailer - Send mail to one recipient How do you send mail to one recipient when form is submitted? You created a simple contact us form and would like to have the results of the form emailed to you. In this tutorial we will create a simple contact form and when the user submits the form results will be mailed to you.

How to do it 1. Open page

Open your asp file that will display the contact form. I have created a form with the following fields: Name, Company, Email, Question/Concern.

Copyright © 2003 DMXzone.com All Rights Reserved to get more go to DMXzone.com

Page 1 of 14

Page 2: Smart Mailer ASP Tutorials - DMXzone€¦ · Smart Mailer ASP Tutorials 2. Create your variables To be able to email the content of the form, you need to create variables for the

Smart Mailer ASP Tutorials

2. Create your variables

To be able to email the content of the form, you need to create variables for the different fields and bind them to the form. I have named my textfields according to the info needed like name, company, email and question. Click on the Bindings tab and the + sign. Select Request Variable, choose Request.Form and fill in the name of your fields. Do this for each field, so four times. In the Bindings you will see this:

3. Apply Smart Mailer extension: Main

You can find the Smart Mailer extension under Server Behaviors | DMXzone | Smart Mailer. There are 4 tabs: Main, Content, Attachments, Setup. Main: Here you can enter where the mail is coming from and where it is going to. For this tutorial I selected One Receiver. In the Submitting choose on any form submit. This will send the mail as soon as a user hits the submit button. Click on the lightning bolts for the dynamic data for the From Name and Email:

Copyright © 2003 DMXzone.com All Rights Reserved to get more go to DMXzone.com

Page 2 of 14

Page 3: Smart Mailer ASP Tutorials - DMXzone€¦ · Smart Mailer ASP Tutorials 2. Create your variables To be able to email the content of the form, you need to create variables for the

Smart Mailer ASP Tutorials

4. Apply Smart Mailer: Content

In Subject I choose to select the company name as dynamic data. In Body I choose Static text/html. This will send a mail with the name, company, email and question he/she has in the mail body. You do not have to enter <br> after each line. It will be automatically done.

Copyright © 2003 DMXzone.com All Rights Reserved to get more go to DMXzone.com

Page 3 of 14

Page 4: Smart Mailer ASP Tutorials - DMXzone€¦ · Smart Mailer ASP Tutorials 2. Create your variables To be able to email the content of the form, you need to create variables for the

Smart Mailer ASP Tutorials

5. Apply Smart Mailer: Attachments

No attachments added for this tutorial.

6. Apply Smart Mailer: Setup

There are four components: CDO (WinXP/Win2000), CDONTS (NT4/Win2000), JMail and ASPEmail. The Ignore errors can be checked when you want the mail to continue even though there is an email address that is incorrect. The Timeout in seconds can be adjusted to your own needs, defaults at 300. In Redirect select the URL users will be directed to after they submit the form. In this case a thank you page.

Copyright © 2003 DMXzone.com All Rights Reserved to get more go to DMXzone.com

Page 4 of 14

Page 5: Smart Mailer ASP Tutorials - DMXzone€¦ · Smart Mailer ASP Tutorials 2. Create your variables To be able to email the content of the form, you need to create variables for the

Smart Mailer ASP Tutorials

7. Click OK

Click the OK button to apply the Smart Mailer extension. A message box will appear that the file incSmartMailer.asp has been copied into your scriptlibrary folder. Make sure you upload the file to the server.

Smart Mailer - Send mail to multiple recipients How do you send mail to multiple recipients when form is submitted You created a newsletter and would like to send it to multiple people from a database. In this tutorial I will show you how to set up an email application that will send personalized template to multiple recipients.

How to do it 1. Open page

Open your asp file that displays a form with a submit button that you will use to send the newsletter.

Copyright © 2003 DMXzone.com All Rights Reserved to get more go to DMXzone.com

Page 5 of 14

Page 6: Smart Mailer ASP Tutorials - DMXzone€¦ · Smart Mailer ASP Tutorials 2. Create your variables To be able to email the content of the form, you need to create variables for the

Smart Mailer ASP Tutorials

2. Create a recordset

To be able to email to multiple recipients from a database, you need to create a recordset. Open the Server Behaviors Panel | Click on the + | Recordset.

3. Apply Smart Mailer extension: Main

You can find the Smart Mailer extension under Server Behaviors | DMXzone | Smart Mailer. There are 4 tabs: Main, Content, Attachments, Setup. Main: Here you can enter where the mail is coming from and where it is going to. In this case we are going to send a newsletter from DMXzone. Select Multiple Receivers. Choose the recordset and fields for name and email. In the Submitting choose on any form submit. This will send the mail as soon as a user hits the submit button.

Copyright © 2003 DMXzone.com All Rights Reserved to get more go to DMXzone.com

Page 6 of 14

Page 7: Smart Mailer ASP Tutorials - DMXzone€¦ · Smart Mailer ASP Tutorials 2. Create your variables To be able to email the content of the form, you need to create variables for the

Smart Mailer ASP Tutorials

4. Apply Smart Mailer: Content

In Subject I choose to select the name of the recipient as dynamic data with Hello, ..... here us our newsletter. Content Type is HTML, since the newsletter is HTML based. When you select the option "Embed images in E-mail" all the images in the newsletter will be send with the mail, making the mail larger. Not selecting this option will result in the recipient not seeing the images if they are not connected to the internet. In Body I choose Template. I choose the newsletter file.

5. Apply Smart Mailer: Attachments

Copyright © 2003 DMXzone.com All Rights Reserved to get more go to DMXzone.com

Page 7 of 14

Page 8: Smart Mailer ASP Tutorials - DMXzone€¦ · Smart Mailer ASP Tutorials 2. Create your variables To be able to email the content of the form, you need to create variables for the

Smart Mailer ASP Tutorials

No attachments added for this tutorial.

6. Apply Smart Mailer: Setup

There are four components: CDO (WinXP/Win2000), CDONTS (NT4/Win2000), JMail and ASPEmail. Select the Server Component you are using. I checked the option Ignore errors so the process of sending the newsletter will keep going no matter what. I increased the Timeout to give the process enough time to complete. Let's show a progress bar during the process. We selected multiple receivers and through the submit button. In Redirect select the URL you will be directed to after the newsletter has been send.

7. Click OK

Click the OK button to apply the Smart Mailer extension. A message box will appear that the files incSmartMailer.asp, cool_green_progress.htm and cool_green_progress.swf have been copied into your scriptlibrary folder. Make sure you upload the file to the server.

Smart Mailer - Send mail with attachment from list How do you send mail to one recipient with an attachment from list You have created a website and every time someone registers you would like to receive an email with the information attached.

Copyright © 2003 DMXzone.com All Rights Reserved

to get more go to DMXzone.com Page 8 of 14

Page 9: Smart Mailer ASP Tutorials - DMXzone€¦ · Smart Mailer ASP Tutorials 2. Create your variables To be able to email the content of the form, you need to create variables for the

Smart Mailer ASP Tutorials

How to do it 1. Open page

Open your asp file that will display the registration form.

2. Apply Smart Mailer extension: Main

You can find the Smart Mailer extension under Server Behaviors | DMXzone | Smart Mailer. There are 4 tabs: Main, Content, Attachments, Setup. Main: Here you can enter where the mail is coming from and where it is going to. For this tutorial I selected One Receiver. In the Submitting choose on any form submit. This will send the mail as soon as a user hits the submit button. Click on the lightning bolts for the dynamic data for the From Name and Email:

3. Apply Smart Mailer: Content

In Subject I entered User Registration. In Body I choose Static text/html. In the body of the mail I will

Copyright © 2003 DMXzone.com All Rights Reserved to get more go to DMXzone.com

Page 9 of 14

Page 10: Smart Mailer ASP Tutorials - DMXzone€¦ · Smart Mailer ASP Tutorials 2. Create your variables To be able to email the content of the form, you need to create variables for the

Smart Mailer ASP Tutorials

4. Apply Smart Mailer: Attachments

Click on Create your Own List, and select through the + button the attachment(s) you would like to send.

5. Apply Smart Mailer: Setup

There are four components: CDO (WinXP/Win2000), CDONTS (NT4/Win2000), JMail and ASPEmail. Select the Server Component you are using. In Redirect select the URL users will be directed to after they submit the form if needed.

Copyright © 2003 DMXzone.com All Rights Reserved to get more go to DMXzone.com

Page 10 of 14

Page 11: Smart Mailer ASP Tutorials - DMXzone€¦ · Smart Mailer ASP Tutorials 2. Create your variables To be able to email the content of the form, you need to create variables for the

Smart Mailer ASP Tutorials

6. Click OK

Click the OK button to apply the Smart Mailer extension. A message box will appear that the file incSmartMailer.asp has been copied into your scriptlibrary folder. Make sure you upload the file to the server.

Smart Mailer - Send mail with attachment from recordset How do you send mail to one recipient with an attachment You created a website where users can purchase products. You would like to send an email with the invoice attached and a purchase confirmation.

How to do it 1. Open page

Open your asp file that will display Purchase Confirmation form. Here the user can see all the info he/she has entered and verify one last time. I assume you have a recordset and possibly session variables to hold all the info.

2. Apply Smart Mailer extension: Main

You can find the Smart Mailer extension under Server Behaviors | DMXzone | Smart Mailer. There are 4 tabs: Main, Content, Attachments, Setup.

Copyright © 2003 DMXzone.com All Rights Reserved to get more go to DMXzone.com

Page 11 of 14

Page 12: Smart Mailer ASP Tutorials - DMXzone€¦ · Smart Mailer ASP Tutorials 2. Create your variables To be able to email the content of the form, you need to create variables for the

Smart Mailer ASP Tutorials

Main: Here you can enter where the mail is coming from and where it is going to. For this tutorial I selected One Receiver. In the Submitting choose on any form submit. This will send the mail as soon as a user hits the submit button. Click on the lightning bolts for the dynamic data for the From Name and Email:

3. Apply Smart Mailer: Content

In Subject I choose to select the company name as dynamic data. In Body I choose a template. They will get a copy of the confirmation mail in the body.

Copyright © 2003 DMXzone.com All Rights Reserved to get more go to DMXzone.com

Page 12 of 14

Page 13: Smart Mailer ASP Tutorials - DMXzone€¦ · Smart Mailer ASP Tutorials 2. Create your variables To be able to email the content of the form, you need to create variables for the

Smart Mailer ASP Tutorials

4. Apply Smart Mailer: Attachments

Select Recordset. Choose the recordset to use and the filefield that contains the filename of the attachment. The invoice will be send as an attachment.

5. Apply Smart Mailer: Setup

There are four components: CDO (WinXP/Win2000), CDONTS (NT4/Win2000), JMail and ASPEmail. Select the Server you are using. I selected to use a progress bar. And a temp folder in my site for the progress bar to use. In Redirect select the URL users will be directed to after they submit the form. In this case a thank you page.

Copyright © 2003 DMXzone.com All Rights Reserved

to get more go to DMXzone.com Page 13 of 14

Page 14: Smart Mailer ASP Tutorials - DMXzone€¦ · Smart Mailer ASP Tutorials 2. Create your variables To be able to email the content of the form, you need to create variables for the

Smart Mailer ASP Tutorials

Copyright © 2003 DMXzone.com All Rights Reserved to get more go to DMXzone.com

Page 14 of 14

6. Click OK

Click the OK button to apply the Smart Mailer extension. A message box will appear that the file incSmartMailer.asp and two files for the progress bar have been copied into your scriptlibrary folder. Make sure you upload the file to the server.