看板 PHP 關於我們 聯絡資訊
※ 引述《frsnic (路人)》之銘言: : 板上有很多phpmailer的教學 : <?php : $mail=new PHPMailer(); : $mail->IsSMTP(); : $mail->SMTPAuth = true; // enable SMTP authentication : $mail->SMTPSecure = "ssl"; // sets the prefix to the servier ^^^^^ : $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server : $mail->Port = 465; // set the SMTP port for the GMAIL server 非25 ^^^^ 用phpinfo,找看看openssl有沒有起來 沒有的話,就用一般通道的寄送 虛擬主機開的EMAIL也可以 或是HINET之類的 : if(!$mail->Send()) { : echo "Mailer Error: " . $mail->ErrorInfo; 應該會出現錯誤訊息才是? : } else { : echo " : 寄信成功! : "; : } : echo $msg."<br>".$header; : ?> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 219.84.185.110