isHTML(true); $mail->CharSet = "UTF-8"; $mail->WordWrap = 80; $mail->setFrom($from_email, $from_name); $mail->AddReplyTo($from_email, $from_name); /**** * Set who the message is to be sent to * CAN BE SET TO addAddress(youremail@website.com, 'Your Name') FOR PRIVATE USER APPROVAL BY MODERATOR * SET TO addAddress($email, $user) FOR USER SELF-VERIFICATION *****/ $mail->addAddress($email, $user); //Sets message body content based on type (verification or confirmation) if ($type == 'Verify') { //Set the subject line $mail->Subject = $user . ' Account Verification'; //Set the body of the message $mail->Body = $verifymsg . '' . $verifyurl . ''; $mail->AltBody = $verifymsg . $verifyurl; } elseif ($type == 'Active') { //Set the subject line $mail->Subject = $site_name . ' Account Created!'; //Set the body of the message $mail->Body = $active_email . '' . $signin_url . ''; $mail->AltBody = $active_email . $signin_url; }; //SMTP Settings if ($mailServerType == 'smtp') { $mail->IsSMTP(); //Enable SMTP $mail->SMTPAuth = true; //SMTP Authentication $mail->Host = $smtp_server; //SMTP Host //Defaults: Non-Encrypted = 25, SSL = 465, TLS = 587 $mail->SMTPSecure = $smtp_security; // Sets the prefix to the server $mail->Port = $smtp_port; //SMTP Port //SMTP user auth $mail->Username = $smtp_user; //SMTP Username $mail->Password = $smtp_pw; //SMTP Password //******************** $mail->SMTPDebug = 0; //Set to 0 to disable debugging (for production) } try { $mail->Send(); } catch (phpmailerException $e) { echo $e->errorMessage(); // Error messages from PHPMailer } catch (Exception $e) { echo $e->getMessage(); // Something else } } } ```
進階搜尋
50人線上 (17人在瀏覽線上書籍)
會員: 0
訪客: 50