S
Salim Afþar
Hi,
I'm using CDO object to send email but it doesn't send any email and it does
not give an error.
My code look like this:
Dim iMsg2
Dim iConf2
Dim Flds2
Const cdoSendUsingPort = 2
set iMsg2 = CreateObject("CDO.Message")
set iConf2 = CreateObject("CDO.Configuration")
Set Flds2 = iConf.Fields
' Set the CDOSYS configuration fields to use port 25 on the SMTP server.
With Flds2
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
cdoSendUsingPort
'ToDo: Enter name or IP address of remote SMTP server.
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"My_SMTP_Server"
..Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
) = 10
.Update
End With
' Apply the settings to the message.
With iMsg2
Set .Configuration = iConf
.To = "<[email protected]>" 'ToDo: Enter a valid email address.
.From = "(e-mail address removed)" 'ToDo: Enter a valid email address.
.Subject = "This is a test CDOSYS message (Sent via Port 25)"
.HTMLBody = "Test"
.Send
End With
' Clean up variables.
Set iMsg2 = Nothing
Set iConf2 = Nothing
Set Flds2 = Nothing
I have checked that a new file called "NTFS_f3a93f2401c34ab30000013f.EML" is
created in the folder "C:\Inetpub\mailroot\Queue\"
Also if I try to use CDO 1.x version I get an error.The code look like this:
Dim objNewMail
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = "(e-mail address removed)"
objNewMail.To = "(e-mail address removed)"
objNewMail.Subject = "Test Subject"
objNewMail.Body = "Test Body"
objNewMail.Send
Set objNewMail = Nothing
Response.Write "Email has been sent"
I think the problem arises from SMTP Server.How can I understand that my
SMTP Server works fine?
Thanks,
Salim
I'm using CDO object to send email but it doesn't send any email and it does
not give an error.
My code look like this:
Dim iMsg2
Dim iConf2
Dim Flds2
Const cdoSendUsingPort = 2
set iMsg2 = CreateObject("CDO.Message")
set iConf2 = CreateObject("CDO.Configuration")
Set Flds2 = iConf.Fields
' Set the CDOSYS configuration fields to use port 25 on the SMTP server.
With Flds2
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
cdoSendUsingPort
'ToDo: Enter name or IP address of remote SMTP server.
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"My_SMTP_Server"
..Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
) = 10
.Update
End With
' Apply the settings to the message.
With iMsg2
Set .Configuration = iConf
.To = "<[email protected]>" 'ToDo: Enter a valid email address.
.From = "(e-mail address removed)" 'ToDo: Enter a valid email address.
.Subject = "This is a test CDOSYS message (Sent via Port 25)"
.HTMLBody = "Test"
.Send
End With
' Clean up variables.
Set iMsg2 = Nothing
Set iConf2 = Nothing
Set Flds2 = Nothing
I have checked that a new file called "NTFS_f3a93f2401c34ab30000013f.EML" is
created in the folder "C:\Inetpub\mailroot\Queue\"
Also if I try to use CDO 1.x version I get an error.The code look like this:
Dim objNewMail
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = "(e-mail address removed)"
objNewMail.To = "(e-mail address removed)"
objNewMail.Subject = "Test Subject"
objNewMail.Body = "Test Body"
objNewMail.Send
Set objNewMail = Nothing
Response.Write "Email has been sent"
I think the problem arises from SMTP Server.How can I understand that my
SMTP Server works fine?
Thanks,
Salim