Sivaswami Jeganathan said:
how to send email from an asp page ?
try this, exchange server example below, remote server below that
' via stmp
Sub sendEmail(whoTo, subject, body)
Dim iMsg
Dim iConf
Dim Flds
Const cdoSendUsingPickup = 1
Const strPickup = "c:\Inetpub\mailroot\pickup"
Set iMsg = CreateObject("CDO.Message")
Set iConf = iMsg.Configuration
With iConf.Fields
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusing") =
cdoSendUsingPickup
.Item("
http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")
= strPickup
.Update
End With
With iMsg
.To = whoTo
.From = "(e-mail address removed)"
.subject = subject
.HTMLBody = body
.Send
End With
End Sub
'via exchange pickup
Sub sendEmail(whoTo, subject, body)
Dim iMsg
Dim iConf
Dim Flds
Const cdoSendUsingPickup = 1
Const strPickup = "c:\Program Files\Exchsrvr\Mailroot\vsi 1\PickUp"
Set iMsg = CreateObject("CDO.Message")
Set iConf = iMsg.Configuration
With iConf.Fields
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusing") =
cdoSendUsingPickup
.Item("
http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")
= strPickup
.Update
End With
With iMsg
.To = whoTo
.From = "(e-mail address removed)"
.subject = subject
.HTMLBody = body
.Send
End With
End Sub
'via remote server
Sub sendEmail(whoTo, subject, body)
Dim iMsg
Dim iConf
Dim Flds
Const mailServer = "yourmailserver.com.au"
Const cdoSendUsingPickup = 2
'Const strPickup = "c:\Program Files\Exchsrvr\Mailroot\vsi 1\PickUp"
Const strPickup = "c:\Inetpub\mailroot\pickup"
Set iMsg = CreateObject("CDO.Message")
Set iConf = iMsg.Configuration
With iConf.Fields
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusing") =
cdoSendUsingPickup
.Item("
http://schemas.microsoft.com/cdo/configuration/smtpserver") =
mailServer
.Update
End With
With iMsg
.To = whoTo
.From = "(e-mail address removed)"
.subject = subject
.HTMLBody = body
.Send
End With
End Sub