v2.5.2
Giriş yap

PHPMailer error yok ve mail gelmiyor

bukr3j
319 defa görüntülendi ve 2 kişi tarafından değerlendirildi
        <?php
                    require 'PHPMailerAutoload.php';
					$subject = "İletişim";			

					// kullanmak istemediğiniz özelliği false yapınız
					$extra = array(
						"form_subject"	=> true, // mesaj konusu
						"form_cc"		=> true, // mesaj kopyasını kendine gönder
						"ip"			=> true, // mesaja ip adresi eklensin mi
						"user_agent"	=> true  // mesaja user agent eklensin mi
					);
					class my_phpmailer extends PHPMailer {
						// Set default variables for all new objects
						public $From     = 'mailadresi';
						public $FromName = 'isim';
						public $Host     = 'host';
						public $Mailer   = 'smtp';                         // Alternative to isSMTP()
						public $WordWrap = 75;

						// Replace the default debug output function
						protected function edebug($msg) {
							print('My Site Error');
							print('Description:');
							printf('%s', $msg);
							exit;
						}
					}


					if ($_POST)
					{
						
						$ad = strip_tags($_POST['ad']);
						$soyad = strip_tags($_POST['soyad']);
						$number = strip_tags($_POST['phone']);
						$email = strip_tags($_POST['email']);
						$message = strip_tags($_POST['message']);
						$baslik = "WEB Mesaj: ";
						$baslik .= $subject; 
					}


						$body = "Sitenizden bir alıcı sizinle iletişime geçmek istiyor.\n\n";
						$body .= "Adı - Soyadı: " . $ad . " " . $soyad ."\n";
						$body .= "Telefon numarası: ". $number . "\n";
						$body .= "Mail adresi: ". $email . "\n";
						$body .= "Mesaj: ". $message . "\n";
						$body = wordwrap($body, 70);

						if (function_exists('mb_encode_mimeheader')) {
							$subject = mb_encode_mimeheader($subject, "UTF-8", "B", "\n");
						}
						else {

						}


					$mail = new my_phpmailer;
					try {
						$mail->isSMTP();
						//Enable SMTP debugging
						// 0 = off (for production use)
						// 1 = client messages
						// 2 = client and server messages
						$mail->SMTPDebug = 2;
						$mail->Mailer = "smtp";
						$mail->Host = "mail.smtp.com";
						$mail->Port = 25;//Set the SMTP port number - likely to be 25, 465 or 587
						$mail->SMTPAuth = true; // turn on SMTP authentication

						$mail->CharSet = 'UTF-8';
						//Ask for HTML-friendly debug output
						$mail->Debugoutput = 'html';
						$mail->SMTPOptions = array(
						'ssl' => array(
							'verify_peer' => false,
							'verify_peer_name' => false,
							'allow_self_signed' => true
							)
						);
						//Whether to use SMTP authentication
						$mail->SMTPAuth = true;
						//Set who the message is to be sent from
						$mail->setFrom($email);
						$mail->SMTPAuth = true;
						//Username to use for SMTP authentication
						
						$mail->Username = "gönderilenmail";//gönderen mail kullanıcı adı
						//Password to use for SMTP authentication
						$mail->Password = "sifre";	
						// Now you only need to add the necessary stuff
						$mail->addAddress('mailadresim', 'Ayberk SOKUL');
						$mail->Subject = $baslik;
						$mail->Body    = $body;	
						
					} catch (phpmailerException $e) {
						echo $e->errorMessage(); //Pretty error messages from PHPMailer
					} catch (Exception $e) {
						echo $e->getMessage(); //Boring error messages from anything else!
					}
	?>
Sorun nerede? PHPMailer en güncel sürümde. phpmailer diye bir klasörde phpmailer ile alakalı her şey. Hata vs de almıoyrum
iskenderhalisoglu
693 gün önce

$mail->Port = 25; 587 olarak değiştirip dener misin?