a litle send mail help

Discussion in 'PHP' started by Kyriakos, Dec 18, 2008.

  1. #1
    hi

    i want to send mails with PHP with SMTP authorization. i have an ASP script that is working. can anybody convert this to PHP?

    <%
    
    Sub sendEmail(eReceiver, eSubject, eBody)
        Set iConf = CreateObject("CDO.Configuration")
        Set myMail = CreateObject("CDO.Message")
        
        Set Flds = iConf.Fields
        Flds(cdoSMTPServer)       = "server01"
        Flds(cdoSMTPServerPort)   = 25		
        Flds(cdoSendUsingMethod)  = cdoSendUsingPort 		
        Flds(cdoSMTPConnectionTimeout) = 120
        Flds(cdoSMTPAccountName) = "COrder@deft.gr"
        Flds(cdoSendUserName) = "COrder"
        Flds(cdoSendPassword) = "2507"		
        Flds(cdoSMTPAuthenticate) =  cdoBasic
        Flds.Update
    
        Set myMail.Configuration = iConf	
        myMail.Subject= eSubject
        myMail.From= "COrder@deft.gr" 'eSender
        myMail.To=eReceiver
        myMail.Bcc= "COrder@deft.gr"
        myMail.HTMLBody = eBody
        myMail.Send
    
        set myMail = nothing
        set iConf = nothing
    End Sub
    
     %>
    Code (markup):
    thanks in advance
     
    Kyriakos, Dec 18, 2008 IP
  2. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #2
    search for phpMailer, it's free and does exactly what you require
     
    crivion, Dec 18, 2008 IP
  3. izwanmad

    izwanmad Banned

    Messages:
    1,064
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0