|
|
|
|
Sending E-Mails with ASP Pages |
|
|
Version |
ASP3 |
|
Description |
This code will show how to send emails with CDO, because it's
available to everyone and components work in a very similar way. First we have to create instance of the NewMail object. |
|
Comments |
Sending an email with asp is fairly easy, all you need is CDONTS
(Collaboration Data Objects for NT Server, installed with IIS), or a special component like SMTPmail by SoftArtisans, or AspEmail ( free ) by Persits Software Inc (there are more available). |
| E-Mail Code : | |
<% Option Explicit Dim objCDOMail Set objCDOMail = Server.CreateObject("CDONTS.NewMail") objCDOMail.To = "[email protected]" 'the destination objCDOMail.From = "[email protected]" 'the sender objCDOMail.cc = "[email protected]" 'carbon copy Dim txtBody txtBody = "This email has been sent by an asp script" objCDOMail.Subject = "CDONTS" 'the subject objCDOMail.Body = txtBody 'the body objCDOMail.Send 'fire off the email %> |
|
| There's more : | |
<% objCDOMail.AttachFile("c:\wwwroot\mysite\" & _ "MyAttachement.doc", "pricelist.doc") objCDOMail.Bcc("[email protected]") objCDOMail.Importance = 1 %> |
|
|
|
|
|
![]()
  Mail Us