مشکل در ارسال ایمیل با این کد

shirani

مدیر انجمن <A href="http://forum.majidonline.com/f
سلام من یک کد برای ارسال ایمیل استفاده کردم که بعد از ثبت نام فرد در دیتا بیس اطلاعات را برای فرد به ایمیل وارد شده میفرسته (این کد من فکر کنم مشکل داشته باشه )

PHP:
<!--#include file="DB.asp" -->
<%
response.Buffer = True
    
'Make sure this page is not cached
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"
Response.Charset = "utf-8"

    ' Open connection to the database
    Set objRS= server.CreateObject("ADODB.recordset")
    objRS.Open "select UserName FROM tbl_Members WHERE UserName ='" & request.form("Username") & "'" , objConn, 1,1
    
    If (objRS.BOF Or objRS.EOF) Then
    
    '----------------------
    ' Open connection to the database
    Set objRS= server.CreateObject("ADODB.recordset")
    objRS.Open "tbl_Members",objconn, ,adLockoptimistic ,adcmdtable

    'Add Comment To DataBase
        objRS.AddNEW        
        objRS ("FullName")= Request.Form("fullname")
        objRS ("UserName")= Request.Form("Username")
        objRS ("Password")= Request.Form("Password")
        objRS ("Email") = Request.Form("Email")
        objRS ("DateofBirthDay")= Request.Form("Day")
        objRS ("DateofBirthMon")= Request.Form("Mon")
        objRS ("DateofBirthYear")= Request.Form("Year")
        objRS.update
        
    'Send Email After RegUser
    'Dimension variables
    Dim strBody             'Holds the body of the e-mail
    Dim objCDOMail             'Holds the mail server object
    Dim strMyEmailAddress         'Holds your e-mail address
    Dim strCCEmailAddress        'Holds any carbon copy e-mail addresses if you want to send carbon copies of the e-mail
    Dim strBCCEmailAddress        'Holds any blind copy e-mail addresses if you wish to send blind copies of the e-mail
    Dim strReturnEmailAddress    'Holds the return e-mail address of the user
    Dim strAdminEmailAddress

'----------------- Place your e-mail address in the following sting ----------------------------------

    strMyEmailAddress = Request.Form("Email")

'----------- Place Carbon Copy e-mail address's in the following sting, separated by ; --------------

    strCCEmailAddress = "" 'Use this string only if you want to send the carbon copies of the e-mail

'----------- Place Blind Copy e-mail address's in the following sting, separated  by ; --------------

    strBCCEmailAddress = "[email protected]" 'Use this string only if you want to send the blind copies of the e-mail

'-----------------------------------------------------------------------------------------------------

    'Read in the users e-mail address
    'strReturnEmailAddress = Request.Form("email")
    'Admin Email
    strAdminEmailAddress = "[email protected]"


    'Initialse strBody string with the body of the e-mail
    strBody = "<h2>www.MyartsBox.com</h2>"
    strBody = strBody & "<br><b>FullName: </b>" & Request.Form("fullname") & " "
    strBody = strBody & "<br><b>E-mail: </b>" & Request.Form("Email") & " "
    strBody = strBody & "<br><b>UserName: </b>" & Request.Form("Username") & " "
    strBody = strBody & "<br><b>UserName: </b>" & Request.Form("Password") & " "
    


    'Check to see if the user has entered an e-mail address and that it is a valid address otherwise set the e-mail address to your own otherwise the e-mail will be rejected
    'If Len(strReturnEmailAddress) < 5 OR NOT Instr(1, strReturnEmailAddress, " ") = 0 OR InStr(1, strReturnEmailAddress, "@", 1) < 2 OR InStrRev(strReturnEmailAddress, ".") < InStr(1, strReturnEmailAddress, "@", 1) Then
    
    'Set the return e-mail address to your own
    'strReturnEmailAddress = strMyEmailAddress
    'End If    


    'Send the e-mail

    'Create the e-mail server object
    Set objCDOMail = Server.CreateObject("CDONTS.NewMail")

    'Who the e-mail is from (this needs to have an e-mail address in it for the e-mail to be sent)
    objCDOMail.From = strAdminEmailAddress

    'Who the e-mail is sent to
    objCDOMail.To = strMyEmailAddress

    'Who the carbon copies are sent to
    objCDOMail.Cc = strCCEmailAddress

    'Who the blind copies are sent to
    objCDOMail.Bcc = strBCCEmailAddress

    'Set the e-mail body format (0=HTML 1=Text)
    objCDOMail.BodyFormat = 0

    'Set the mail format (0=MIME 1=Text)
    objCDOMail.MailFormat = 0

    'Set the subject of the e-mail
    objCDOMail.Subject = "Welcome To MyartsBox.com (Information)"

    'Set the main body of the e-mail
    objCDOMail.Body = strBody

    'Importance of the e-mail (0=Low, 1=Normal, 2=High)
    objCDOMail.Importance = 1 

    'Send the e-mail
    objCDOMail.Send
    
    'Close the server object
    Set objCDOMail = Nothing
    
    
    ' Close Connection
    objRS.Close 
    Set objRS = Nothing
    objconn.close    
    set objconn = nothing    
    
        'Redirect
        response.Redirect("../default.asp")

    else
        'Redirect
        response.Redirect("../RegUser.asp?ER=No add User Please Change Username")
    end if
    
    
%>
 

shirani

مدیر انجمن <A href="http://forum.majidonline.com/f
فکر نکنم میخواستم ببینم چی باید نصب کنم یا چه کامپوننتی نیاز برای این کار
 

shirani

مدیر انجمن <A href="http://forum.majidonline.com/f
پلاسک 8.1 بود الان داریم سرور عوض میکنیم معلوم نیست هنوز
 

جدیدترین ارسال ها

بالا