-3
我剛上傳我的網站到一個活的服務器,它不再發送電子郵件,網絡主持人希望我使用PHPMAILER。問題是我的代碼在過程接口中,PHPMAILER在OOP中。請幫助我將OOP更改爲程序。如何使用php程序界面實現PHPMAILER?我想發送驗證郵件
$to = $email; // Send email to our user
$subject = 'Signup | Verification'; // Give the email a subject
$message = '
Thanks for signing up!
Your account has been created, you can login with the following credentials after you have activated your account by copying the url below
and pasting it in your brwoser.
------------------------
Username: '.$email.'
Password: '.$pass.'
------------------------
Please copy and paste this link in the address field and press enter to activate your account:<br>
http://elam.rpaz.co.zw/verify.php?email='.$email.'&password='.$cryptpass.'
'; // Our message above including the link
$headers = 'From:[email protected]' . "\r\n";
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "mail-2.sslzol.co.zw";
$mail->Port = 6465;
$mail->Username = '[email protected]';
$mail->Password = 'rp15kuyuelamhvkyu';
$mail->Subject = trim("Signup | Verification");
$mail->SetFrom('[email protected]', 'RPAZ e(LAM)');
$mail->AddAddress($email);
$mail->MsgHTML($message);
try {
$mail->send();
} catch (Exception $ex) {
echo $msg = $ex->getMessage();
}
echo "1 record added";
mysqli_close($conn);
header("Location: redirect.html");
exit;
}
我有一個混合OOP和程序錯誤。請幫助 – leenold
可以分享錯誤plz。 –
致命錯誤:在109行的C:\ wamp64 \ www \ e(LAM)\ reg.php中找不到Class'PHPMailer' – leenold