Quantcast
Channel: BTSoru.com - Bilisim ve Yazilim Teknolojileri Soru/Cevap Platformu - latest questions
Viewing all articles
Browse latest Browse all 4270

Phpmailer ile mail gönderimi sorunu

$
0
0

Sunucumda(yerel değil) bir iletişim formundan gelen bilgileri kendi mail adresime göndermem gerek ancak bir şekilde sunucu bunu gerçekleştiremiyor ve şu hatayı veriyor: Message could not be sent.Mailer Error: The following From address failed: info@myserver.com : Called Mail() without being connected
Kodlar şunlar:

$mail = new PHPMailer;

$mail->IsSMTP();    // Set mailer to use SMTP
$mail->Host = 'localhost';  // Specify main and backup server
$mail->SMTPAuth = true;    // Enable SMTP authentication
$mail->Username = 'info@myserver.com';  // SMTP username
$mail->Password = 'mypassword'; // SMTP password
$mail->SMTPSecure = 'tls';  // Enable encryption, 'ssl' also accepted

$mail->From = 'info@myserver.com';
$mail->FromName = 'John Smith';  // Add a recipient
$mail->AddAddress('myemail@gmail.com');  // Name is optional
// $mail->AddReplyTo('info@example.com', 'Information');

$mail->WordWrap = 70;                                 // Set word wrap to 50 characters
$mail->IsHTML(true);                                  // Set email format to HTML

$mail->Subject = 'Here is the subject';
$mail->Body    = 'This is the HTML message body in bold!';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

if(!$mail->Send()) {
   echo 'Message could not be sent.';
   echo 'Mailer Error: ' . $mail->ErrorInfo;
   exit;
}

Viewing all articles
Browse latest Browse all 4270

Trending Articles


huddam daveti


Tekasür Suresi


"Yâ Kuddûs!" Esması Havâs ve Esrârı


Kasemi Mübelliğa


Peri44


Kuvvetli muhabbet ve aşk tılsımı


El-Mütekebbir


Papaz büyüsü


SCCM 2012 Client Installation issue


Zilhicce Ayının Namaz Duası ÖNEMLİ