+ Konuya Yorum Yaz + Yeni Konu Aç
Gösterilen sonuçlar: 1 ile 1 Toplam: 1

Bütün E-Posta Bileşenleri İle Mail Göndermek.

<% '######################## Sub SendMail(SendTo,From,ReplyTo,Subject,Body,Attachments) MailComponent="cdo"'### Buraya Hangi Bileşen İle Göndercekseniz Onu Yazın Aşağıdakilerden. are: "jmail", "aspmail", "cdo" or "cdonts" (Note: cdonts only works with the local server, SMTPMailServer is ignored! CDO has problems on some servers.). MailServer="localhost"'### SMTP Mailserver to be used to send account information to users.

  1. #1
    Üyecik
    Üyelik tarihi
    Dec 2005
    Mesaj
    7
    Rep Gücü
    14

    Bütün E-Posta Bileşenleri İle Mail Göndermek.

    HTML-Kodu:
    <%
    
    '########################
    Sub  SendMail(SendTo,From,ReplyTo,Subject,Body,Attachments)
    
    MailComponent="cdo"'### Buraya Hangi Bileşen İle Göndercekseniz Onu Yazın Aşağıdakilerden.
    are: "jmail", "aspmail", "cdo" or "cdonts" (Note: cdonts only works  with  the local server, SMTPMailServer is ignored! CDO has problems on some servers.).
    MailServer="localhost"'### SMTP Mailserver  to  be used  to  send account information  to  users.
    
    SenderIp=Request.ServerVariables("HTTP_X_FORWARDED_FOR")'Sender ip
    
    
    
    ' ### Send mail  with  jmail
    If  LCase(MailComponent="jmail")  Then  
         Set  Msg = Server.CreateObject( "JMail.Message" )
        Msg.ISOEncodeHeaders =  false
        Msg.AddRecipient SendTo
         If  ReplyTo<>""  Then  Msg.ReplyTo = ReplyTo
        Msg.From = From
        Msg.Subject = Subject
        Msg.Body = Body
        If  IsArray(Attachments)  Then
             For  i = 0 To  Ubound(Attachments)
                Msg.AddAttachment Attachments(i)
             Next
         End  If
        Msg.AddHeader "Originating-IP", SenderIp
        Msg.send(MailServer)
        Msg.close
         Set  Msg=Nothing
    
    ' ### Send mail  with  AspMail
    ElseIf  LCase(MailComponent="aspmail")  Then
         Set  Mailer = Server.CreateObject("SMTPsvg.Mailer")
        Mailer.FromAddress = From
        Mailer.AddRecipient SendTo,SendTo
         If  ReplyTo<>""  Then  Mailer.ReplyTo = ReplyTo
        Mailer.Subject = Subject
        Mailer.BodyText = Body
        If  IsArray(Attachments)  Then
             For  i = 0 To  Ubound(Attachments)
                Mailer.AddAttachment Attachments(i)
             Next
         End  If
        Mailer.AddExtraHeader "Originating-IP: " & SenderIp
        Mailer.RemoteHost = MailServer
        SentOK=Mailer.SendMail 
         Set  Mailer=Nothing
    
    ' ### Send mail  with  Cdonts
    ElseIf  LCase(MailComponent="cdonts")  Then
         Set  objNewMail = Server.CreateObject("CDONTS.NewMail")
        objNewMail.From = From
         If  ReplyTo<>""  Then  objNewMail.Value("Reply-To") = ReplyTo
        objNewMail.Value("Originating-IP") = SenderIp
        objNewMail.To = SendTo
        objNewMail.Subject =Subject
        objNewMail.Body = Body
        objNewMail.BodyFormat=1
        objNewMail.MailFormat=0
        If  IsArray(Attachments)  Then
             For  i = 0 To  Ubound(Attachments)
                objNewMail.AttachFile Attachments(i)
             Next
         End  If
        objNewMail.Send
         Set  objNewMail =  Nothing
    
    ' ### Send mail  with  Cdo
    ElseIf  LCase(MailComponent="cdo")  Then
         Set  cdoConfig = Server.CreateObject("CDO.Configuration")
        sch = "http://schemas.microsoft.com/cdo/configuration/" 
        cdoConfig.Fields.Item(sch & "sendusing") = 2
        cdoConfig.Fields.Item(sch & "smtpserver") = MailServer
        'cdoConfig.Fields.Item(sch & "authenticate") = 2 'Type of authentication, NONE, Basic (Base64 encoded), NTLM
        'cdoConfig.Fields.Item(sch & "sendusername") = "username"
        'cdoConfig.Fields.Item(sch & "sendpassword") = "parolam"
        cdoConfig.Fields.Item(sch & "smtpserverport") = 25
        'cdoConfig.Fields.Item(sch & "smtpusessl") =  False
        cdoConfig.fields.update
          Set  objNewMail = Server.CreateObject("CDO.Message")
         Set  objNewMail.Configuration = cdoConfig
        objNewMail.From= From
        objNewMail.To= SendTo
        objNewMail.ReplyTo= ReplyTo
        'objNewMail.Cc= SendTo
        'objNewMail.Bcc= SendTo
        objNewMail.Subject=Subject
        objNewMail.TextBody=Body
        'objNewMail.HtmBody = "<h1>Thtml</h1>" 
        'objNewMail.HtmBody = "file://c|/temp/test.htm"
        'objNewMail.HtmBody = "http://www.smslust.net"
    
        If  IsArray(Attachments)  Then
             For  i = 0 To  Ubound(Attachments)
                objNewMail.AddAttachment Attachments(i)
             Next
         End  If
        objNewMail.Send
         Set  objNewMail =  Nothing  
    End  If
    End  Sub
    
    
    
    SendTo="a@dd.com"
    From="noreply@prowww.net"
    ReplyTo="sss@dd.com"
    Subject="Selam"
    Body="Test"
    SendMail SendTo,From,ReplyTo,Subject,Body,Attachments
    
    %>

  2. # ADS
    İlginizi Çekebilir
    Üyelik tarihi
    Daima
    Mesaj
    Çok:)
     

Benzer Konular

  1. Fermuar Modelleri, Fermuar Bileşenleri ve Fermuarların Sınıflandırılması
    1nicefermuar Tarafından Bu günlerde Ne Moda? Foruma
    Yorum: 0
    Son mesaj: 19-07-2017, 03:42 PM
  2. Mars'a Robot Göndermek Caiz mi?
    SOSYALİST Tarafından Dini Sohbet Foruma
    Yorum: 8
    Son mesaj: 09-09-2012, 08:18 AM
  3. İnternette truva atı göndermek
    ashenarşi Tarafından Süper Sözlük Foruma
    Yorum: 0
    Son mesaj: 13-04-2010, 06:38 PM
  4. Mail
    İnci Tarafından Süper Sözlük Foruma
    Yorum: 0
    Son mesaj: 23-03-2010, 04:36 AM
  5. Kıbrıs'la İlgili Bütün Belgeler, Bütün Gerçekler
    dogangunes Tarafından Tarih Forum'u Foruma
    Yorum: 6
    Son mesaj: 06-11-2007, 04:04 AM