से कनेक्ट नहीं हो सका मैं ईमेल के माध्यम से उपयोगकर्ताओं को पुष्टिकरण संदेश भेजने के लिए phpMailer का उपयोग करने की कोशिश कर रहा हूं। मेरा कोड यह है:PHPMailer जीमेल का उपयोग एसएमटीपी सर्वर के रूप में करने के लिए। एसएमटीपी होस्ट से कनेक्ट नहीं हो सकता है। मेलर त्रुटि: एसएमटीपी त्रुटि: एसएमटीपी होस्ट
<?php
include("class.phpmailer.php");
include("class.smtp.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "ssl://smtp.gmail.com"; // specify main and backup server
$mail->Port = 465; // set the port to use
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "[email protected]"; // your SMTP username or your gmail username
$mail->Password = "mypasswrord"; // your SMTP password or your gmail password
$from = "[email protected]"; // Reply to this email
$to="[email protected]"; // Recipients email ID
$name="Jersey Name"; // Recipient's name
$mail->From = $from;
$mail->FromName = "Webmaster"; // Name to indicate where the email came from when the recepient received
$mail->AddAddress($to,$name);
$mail->AddReplyTo($from,"Webmaster");
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Sending Email From Php Using Gmail";
$mail->Body = "This Email Send through phpmailer, This is the HTML BODY "; //HTML Body
$mail->AltBody = "This is the body when user views in plain text format"; //Text Body
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent";
}
?>
मैं पहले ही php.ini में एसएसएल सक्षम कर चुका हूं।
पीएस> [email protected] गोपनीयता की रक्षा के लिए एक मुखौटा ईमेल है। लेकिन मैं उस भाग
आप http://swiftmailer.org/ का उपयोग कर विचार किया है? यह जीमेल के माध्यम से ईमेल भेजने के लिए बॉक्स से बाहर काम करता है। महान पुस्तकालय! :-) – Flukey
इसके अलावा, "ssl: //smtp.gmail.com" से परिवर्तन मेजबान "smtp.gmail.com" – Flukey
कुछ भी नहीं सब पर हुआ .. नहीं भी एक गूंज – phpDeveloperForThesis