2017-04-25 201 views
0

我開發一個PHP註冊頁面後,用戶註冊成功,他將得到感謝你從我的域名 郵件,但我想這個PHP代碼的電子郵件不發送 PHP腳本發送電子郵件從

GoDaddy的帳戶
$reg_query = mysqli_query($conn, "INSERT INTO `at_reg_user`(`fname`, `lname`, `email`, `password`, `mobile`, `class`, `ipaddress`) VALUES ('$fname','$lname','$email','$password1','$mobile','$class','$remote')"); 

     if ($reg_query) { 

      $mail = new PHPMailer(); 
      $mail->IsSMTP(); 
      $mail->Host = "mail.aenugulakarthik.in"; 
      $mail->SMTPAuth = true; 
      $mail->Username = "[email protected]"; 
      $mail->Password = "xxxxxxx"; 
      $mail->From = "[email protected]"; 
      $mail->FromName = "KarthikAenugula"; 
      $mail->AddAddress($email); 
      $mail->AddReplyTo("[email protected]"); 
      $mail->WordWrap = 50; 
      $mail->IsHTML(true); 
      $mail->Subject = "Here is the subject"; 
      $mail->Body = "This is the HTML message body <b>in bold!</b>"; 
      $mail->AltBody = "This is the body in plain text for non-HTML mail clients"; 

      if ($mail->send()) 
      { 
       echo("<SCRIPT LANGUAGE='JavaScript'> 
         window.alert(' Registration Successful') 
         </SCRIPT>"); 

      } else { 

       echo("<SCRIPT LANGUAGE='JavaScript'> 
         window.alert(' Mail unsent') 
         </SCRIPT>"); 
      } 
+0

重定向嘗試捕捉異常/調試 – webpic

+0

嘗試使用PHP的'mail'功能http://stackoverflow.com/questions/1268012/phpmailer-v-mail後-for-a-simple-contact-form – julekgwa

+0

@John Conde請在保留重複問題前檢查問題 –

回答

0

在這裏,

$reg_query = mysqli_query($conn, "INSERT INTO `at_reg_user`(`fname`, `lname`, `email`, `password`, `mobile`, `class`, `ipaddress`) VALUES ('$fname','$lname','$email','$password1','$mobile','$class','$remote')"); 

    if ($reg_query) { 

     $mail = new PHPMailer(); 
     $mail->IsSMTP(); 
     $mail->Host = "mail.aenugulakarthik.in"; 
     $mail->SMTPAuth = true; 
     $mail->Username = "[email protected]"; 
     $mail->Password = "xxxxxxx"; 
     $mail->From = "[email protected]"; 
     $mail->FromName = "KarthikAenugula"; 
     $mail->AddAddress($email); 
     $mail->AddReplyTo("[email protected]"); 
     $mail->WordWrap = 50; 
     $mail->IsHTML(true); 
     $mail->Subject = "Here is the subject"; 
     $mail->Body = "This is the HTML message body <b>in bold!</b>"; 
     $mail->AltBody = "This is the body in plain text for non-HTML mail clients"; 

     if ($mail->send()) 
     { 
      echo("<SCRIPT LANGUAGE='JavaScript'> 
        window.alert(' Registration Successful') 
        </SCRIPT>"); 

     } else { 

      echo("<SCRIPT LANGUAGE='JavaScript'> 
        window.alert(' Mail unsent') 
        </SCRIPT>"); 
     } 

你需要有你的豪godaddy的st名字。像

sg2plcpnlXXXX.prod.sin2.secureserver.net 

,你可以得到它,你從<domain.com/cpanel>