2008 Sunucularda cdo objesini nasıl kullanabileceğinizi aşağıdaki örnek kodlardan inceleyebilirsiniz.
Dim sMsg Dim sTo Dim sFrom Dim sSubject Dim sTextBody Dim sHTMLBody
'Get data from previous page sTo = Request("sTo") sFrom = Request("sFrom") sSubject = Request("sSubject") sTextBody = Request("sTextBody") sHTMLBody = Request("sHTMLBody")
'Only run this if it's not the first time If Request.Form("Submit") <> "" Then
Dim objMail 'Create the mail object Set objMail = Server.CreateObject("CDO.Message") 'Set key properties objMail.From = sFrom objMail.To = sTo objMail.Subject= sSubject objMail.TextBody = sTextBody objMail.HTMLBody = sHTMLBody
'Send the email objMail.Send 'Set sMsg which will be used later sMsg = "Your message was sent to: " & sTo
'Clean-up Set objMail = Nothing
End If |