using classic asp sending the mail.

Posted by Jameschowdare under Others on 5/14/2010 | Views : 2202 | Status : [Member] | Replies : 4
to send email ,
i used this code but it was not working.

Dim ObjMail
Set ObjMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = varName & " <" & varEmail & ">"
objMail.To = "upen.rao@target.com"
objMail.Subject = "Contact from Your Website"
objMail.Body = varName & ""_
& VBCrLf & varCompany & ""_
& VBCrLf & varTelephone & ""_
& VBCrLf & VBCrLf & varComments & VBCrLf
objMail.Send
Set objMail = Nothing
i was used that it is not working, is there need to configure fo Email appplication,
and im using the windows XP Professional




Responses

Posted by: Ajaydabhade on: 5/14/2010 [Member] Starter

Up
0
Down
Try this code


Dim objCDO
Dim mybody
Set objCDO = CreateObject("CDO.Message")
objCDO.To = "to@abc.com"
objCDO.From = "from@abc.com"
objCDO.bcc = "bcc@abc.com"
objCDO.Subject = "Test Mail"
objCDO.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'exchsrv.bharatforge.com'
objCDO.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="exchsrv.bharatforge.com"
'Server port
objCDO.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=25
objCDO.Configuration.Fields.Update
mybody = "Hello"
objCDO.TextBody = mybody
objCDO.Send
Set objCDO = Nothing

AJAY DABHADE
(MCPD, MCTS)
"Plan your work, work on your plan and your plan will work."

Jameschowdare, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 5/14/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Jameschowdare if i may ask , why are you still developing in asp classic ?

Thank you for posting at Dotnetfunda
[Administrator]

Jameschowdare, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Er.deepakdalal on: 5/15/2010 [Member] Starter

Up
0
Down

Posted by: Jameschowdare on: 5/17/2010 [Member] Starter

Up
0
Down
Error:The transport failed to connect to the server

above also not working...............

giving the first line "as error"

Jameschowdare, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response