Ajax
ASP
C,C++
C#,.NET
CSS,HTML
Delphi,Kylix
Experience
Flash
Java
JavaScript
PHP
Python
QT
SQL
ShellScript
VB
U :
P :
Register
Lost Password
Other Links
Code Archive
Save Giovanni
ASP Category Code
Real Name
:
Mustafa Agâh Öztürk
Subject
:
Yüklü Bileşene Göre E-Posta Gönderimi
Description
:
Sunucuda yüklü bileşeni otomatik bulur ve e-posta gönderir. Kullanımı kodların altında verilmiştir.
<% Class AEAR_System_WebMail Private arrMailComponent(3) Private Com Private Object Private strServer, _ strSender, _ strSenderName, _ strRecipient, _ strBCC, _ strSubject, _ strBody, _ blnFormat Private Sub Class_Initialize() arrMailComponent(0) = "Persits.MailSender" arrMailComponent(1) = "SMTPsvg.Mailer" arrMailComponent(2) = "JMail.SMTPMail" arrMailComponent(3) = "CDONTS.NewMail" Com = null End Sub Private Sub Class_Terminate() If IsObject(Com) Then Set Com = Nothing End Sub Public Property Let ServerName(byVal Str) strServer = Str End Property Public Property Let Sender(byVal Str) strSender = Str End Property Public Property Let SenderName(byVal Str) strSenderName = Str End Property Public Property Let Recipient(byVal Str) strRecipient = Str End Property Public Property Let BCC(byVal Str) strBCC = Str End Property Public Property Let Subject(byVal Str) strSubject = Str End Property Public Property Let Body(byVal Str) strBody = Str End Property Public Property Let Format(byVal bln) blnFormat = bln End Property Private Function ActiveXControl() On Error Resume Next Dim c c = False For ac = 0 To uBound(arrMailComponent) Set Com = Server.CreateObject(arrMailComponent(ac)) If IsObject(Com) Then c = True : Object = arrMailComponent(ac) Err.Clear : On Error GoTo 0 Exit For End If Next ActiveXControl = c End Function Public Default Function Send() If IsObject(Com) Then Set Com = Nothing : Com = null Dim C C = ActiveXControl() If C Then Select Case(Object) Case "Persits.MailSender" 'Com.Host = strServer 'Com.From = strSender 'Com.FromName = strSenderName 'Com.AddAddress = strRecipient 'Com.AddBcc = strBCC 'Com.Subject = strSubject 'Com.IsHTML = blnFormat 'Com.Body = strBody 'Com.Send Case "SMTPsvg.Mailer" Com.RemoteHost = strServer Com.FromAddress = strSender Com.FromName = strSenderName Com.AddRecipient " ", strRecipient Com.AddBCC " ", strBCC Com.Subject = strSubject If blnFormat = True Then Com.ContentType = "text/HTML" Com.BodyText = strBody Com.SendMail Case "JMail.SMTPMail" Com.ServerAddress = strServer Com.Sender = strSender Com.SenderName = strSenderName Com.AddRecipient strRecipient Com.AddRecipientBCC = strBCC Com.Subject = strSubject If blnFormat = True Then Com.HTMLBody = strBody Else Com.Body = strBody End If Com.Priority = 3 Com.Execute Case "CDONTS.NewMail" If blnFormat Then blnFormat = 1 Else blnFormat = 0 End If Com.From = strSenderName &" <"& strSender &">" Com.To = strRecipient Com.Subject = strSubject Com.Body = strBody Com.BodyFormat = blnFormat Com.MailFormat = blnFormat Com.Bcc = strBCC Com.Importance = 2 Com.Send End Select If IsObject(Com) Then Set Com = Nothing End If Else System.Write("Sisteminizde Desteklenen E-Posta Kütüphanesi Bulunmamakdatır!") End If End Function End Class %> Kullanımı : <% Set Mail = New AEAR_System_WebMail Mail.ServerName = "127.0.0.1" Mail.SenderName = "Semih TURNA" Mail.Sender = "semih.turna@test.com" Mail.Recipient = "semih.turna@testtest.com" Mail.Subject = "Deneme Maili" Mail.Body = "Bu Bir Deneme<br><b>deneme deneme</b>" Mail.Send() %>
Rating
:
4.00
(out of 5)
Visitor Voting Booth
:
Excellent
Very Good
Good
Fair
Poor
Copyright © 2006 SharingCode.NET . All rights reserved. Hosted By: SisNetworks