• 29-01-2018, 03:39:59
    #1
    Herkese merhabalar. Daha önce bildiğim, fakat uzun zamandır üzerinde çalışma veya deneme yapmadığım için unuttuğum bir sorunla karşı karşıyayım.
    HTML bir iletişim formuna sahibim. Bu iletişim formu aracılığıyla PHPMailer üzerinden belirlediğim mail adresine mail göndermek istiyorum. Tabi bunu yaparken de iletişim formu üzerinde bulunan alanlardan bilgileri almam gerekiyor. Daha önce bunu yapıyordum fakat demin de dediğim gibi, çok uzun zamandır kullanmadığım için nasıl yapıldığını unutmuşum.
    Bana bu konuda yardımcı olacak arkadaşlar var mı? Şimdiden teşekkür ederim.



    İzlemem gereken yolu söyleyecek bir arkadaş olsa bile yeterli. Hala yardım bekliyorum... 🙁
  • 30-01-2018, 02:09:50
    #2
    Bende uzun uğraşlar sonu yapabilmiştim, mail fonksiyonu artık desteklenmediğinden smtp kullanmak gerekiyor, aşağıda benim kullandığım smtp kontrol sayfasının mail gönderme yerleri mevcut, smtp_host diye başlayan ilk sıralı alana ilgili detayları gmail veya kendi site adresinin mail detaylarını yazmalısın, bununla ilgili nette çok bilgi var. Çoklu mail gönderme özelliğide var bu kodun mailleri virgülle ayırmak gerek.
     include("../../class/class.phpmailer.php");
    
    $t_smtp_host           = $site_smtp_host;
    $t_smtp_username       = $site_smtp_username;
    $t_smtp_password       = $site_smtp_password;
    $t_smtp_add_reply_to   = $site_smtp_add_reply_to;
    $t_smtp_from           = $site_smtp_username;
    $t_smtp_from_name      = $site_smtp_from_name;
    $t_smtp_smtp_auth      = $site_smtp_auth;
    $t_smtp_smtp_secure    = $site_smtp_secure;
    $t_smtp_smtp_port      = $site_smtp_port;
    $t_smtp_add_adress     = $site_iletisim_mail;
    $t_smtp_smtp_subject   = $site_smtp_from;
    
    $t_isim    = $t_isim;
    $t_soyisim = $t_soyisim;
    $t_telefon = $t_telefon;
    $t_mail    = $t_mail;
    $t_mesaj   = $t_mesaj;
    
    
    $message = &quot;Tarih :&quot;.$s_tarih.&quot;<br />&quot;.
    &quot;Geldiği Konum : ilgix.com İletişim Formu<br />&quot;.
    &quot;İsim Soyisim:&quot;.$t_isim.&quot;<br />&quot;.
    &quot;E-Mail :&quot;.$t_mail.&quot;<br /><p>&quot;.
    &quot;Mesaj :&quot;.$t_mesaj.&quot;</p>&quot;.&quot;\n&quot;;
    
     $t_smtp_smtp_wordwrap  = &quot;80&quot;;
    $t_smtp_body           = nl2br($message);
    $t_smtp_smtp_charset   = &quot;utf-8&quot;;
    
      try {
    $mail = new PHPMailer(true); //New instance, with exceptions enabled
     //$body             = file_get_contents('contents.html');
    //$body             = preg_replace('/\\\\/','', $body); //Strip backslashes
     $body = $t_smtp_body;
    
     $mail->IsSMTP();                           // tell the class to use SMTP
    $mail->SMTPAuth   = $t_smtp_smtp_auth;    // enable SMTP authentication
    $mail->SMTPSecure = $t_smtp_smtp_secure;  // Options are &quot;&quot;, &quot;ssl&quot; or &quot;tls&quot;
    $mail->Port       = $t_smtp_smtp_port;    // set the SMTP server port
    $mail->Host       = $t_smtp_host;         // SMTP server
    $mail->Username   = $t_smtp_username;    // SMTP server username
    $mail->Password   = $t_smtp_password;    // SMTP server password
     $mail->CharSet    = $t_smtp_smtp_charset;
    
      //$mail->IsSendmail();  // tell the class to use Sendmail
     $mail->AddReplyTo($t_smtp_add_reply_to,$t_smtp_from_name);
     $mail->From       = $t_smtp_from;
    $mail->FromName   = $t_smtp_from_name;
    
     $t_s_m_m_a_dizi     = explode(',',$t_smtp_add_adress);
    $t_s_m_m_a_dizi_say = count($t_s_m_m_a_dizi);
     $dizi_sayac = 0;
    while($dizi_sayac < $t_s_m_m_a_dizi_say)
    {
    $t_smtp_add_adress = $t_s_m_m_a_dizi[$dizi_sayac];
    
    $mail->AddAddress($t_smtp_add_adress);
    $dizi_sayac++;
    }
    
     //$mail->AddAttachment($t_smpt_add_attachment);      // attachment
     $mail->Subject  = $t_smtp_smtp_subject;
     //$mail->AltBody    = $t_smtp_smtp_altbody;  // optional, comment out and test
    $mail->WordWrap   = $t_smtp_smtp_wordwrap; // set word wrap
     $mail->MsgHTML($body);
     $mail->IsHTML(true); // send as HTML
     $mail->Send();
      //$_SESSION['iletisim_uyari'] = 'Mesajınız Ulaşmıştır Teşekkürler';
    //header(&quot;Location:$geldigi_yer&quot;);
    //exit();
      } catch (phpmailerException $e) {
    //echo $e->errorMessage();
     //$_SESSION['iletisim_uyari'] = $e->errorMessage(); //'Hata ! Mesajınız Ulaşmadı Lütfen Doğrudan Mail Gönderin';
    //header(&quot;Location:$geldigi_yer&quot;);
    //exit();
     }
  • 30-01-2018, 02:40:03
    #3
    ilgixcom adlı üyeden alıntı: mesajı görüntüle
    Bende uzun uğraşlar sonu yapabilmiştim, mail fonksiyonu artık desteklenmediğinden smtp kullanmak gerekiyor, aşağıda benim kullandığım smtp kontrol sayfasının mail gönderme yerleri mevcut, smtp_host diye başlayan ilk sıralı alana ilgili detayları gmail veya kendi site adresinin mail detaylarını yazmalısın, bununla ilgili nette çok bilgi var. Çoklu mail gönderme özelliğide var bu kodun mailleri virgülle ayırmak gerek.
     include(&quot;../../class/class.phpmailer.php&quot;);
    
    $t_smtp_host           = $site_smtp_host;
    $t_smtp_username       = $site_smtp_username;
    $t_smtp_password       = $site_smtp_password;
    $t_smtp_add_reply_to   = $site_smtp_add_reply_to;
    $t_smtp_from           = $site_smtp_username;
    $t_smtp_from_name      = $site_smtp_from_name;
    $t_smtp_smtp_auth      = $site_smtp_auth;
    $t_smtp_smtp_secure    = $site_smtp_secure;
    $t_smtp_smtp_port      = $site_smtp_port;
    $t_smtp_add_adress     = $site_iletisim_mail;
    $t_smtp_smtp_subject   = $site_smtp_from;
    
    $t_isim    = $t_isim;
    $t_soyisim = $t_soyisim;
    $t_telefon = $t_telefon;
    $t_mail    = $t_mail;
    $t_mesaj   = $t_mesaj;
    
    
    $message = &quot;Tarih :&quot;.$s_tarih.&quot;<br />&quot;.
    &quot;Geldiği Konum : ilgix.com İletişim Formu<br />&quot;.
    &quot;İsim Soyisim:&quot;.$t_isim.&quot;<br />&quot;.
    &quot;E-Mail :&quot;.$t_mail.&quot;<br /><p>&quot;.
    &quot;Mesaj :&quot;.$t_mesaj.&quot;</p>&quot;.&quot;\n&quot;;
    
     $t_smtp_smtp_wordwrap  = &quot;80&quot;;
    $t_smtp_body           = nl2br($message);
    $t_smtp_smtp_charset   = &quot;utf-8&quot;;
    
      try {
    $mail = new PHPMailer(true); //New instance, with exceptions enabled
     //$body             = file_get_contents('contents.html');
    //$body             = preg_replace('/\\\\/','', $body); //Strip backslashes
     $body = $t_smtp_body;
    
     $mail->IsSMTP();                           // tell the class to use SMTP
    $mail->SMTPAuth   = $t_smtp_smtp_auth;    // enable SMTP authentication
    $mail->SMTPSecure = $t_smtp_smtp_secure;  // Options are &quot;&quot;, &quot;ssl&quot; or &quot;tls&quot;
    $mail->Port       = $t_smtp_smtp_port;    // set the SMTP server port
    $mail->Host       = $t_smtp_host;         // SMTP server
    $mail->Username   = $t_smtp_username;    // SMTP server username
    $mail->Password   = $t_smtp_password;    // SMTP server password
     $mail->CharSet    = $t_smtp_smtp_charset;
    
      //$mail->IsSendmail();  // tell the class to use Sendmail
     $mail->AddReplyTo($t_smtp_add_reply_to,$t_smtp_from_name);
     $mail->From       = $t_smtp_from;
    $mail->FromName   = $t_smtp_from_name;
    
     $t_s_m_m_a_dizi     = explode(',',$t_smtp_add_adress);
    $t_s_m_m_a_dizi_say = count($t_s_m_m_a_dizi);
     $dizi_sayac = 0;
    while($dizi_sayac < $t_s_m_m_a_dizi_say)
    {
    $t_smtp_add_adress = $t_s_m_m_a_dizi[$dizi_sayac];
    
    $mail->AddAddress($t_smtp_add_adress);
    $dizi_sayac++;
    }
    
     //$mail->AddAttachment($t_smpt_add_attachment);      // attachment
     $mail->Subject  = $t_smtp_smtp_subject;
     //$mail->AltBody    = $t_smtp_smtp_altbody;  // optional, comment out and test
    $mail->WordWrap   = $t_smtp_smtp_wordwrap; // set word wrap
     $mail->MsgHTML($body);
     $mail->IsHTML(true); // send as HTML
     $mail->Send();
      //$_SESSION['iletisim_uyari'] = 'Mesajınız Ulaşmıştır Teşekkürler';
    //header(&quot;Location:$geldigi_yer&quot;);
    //exit();
      } catch (phpmailerException $e) {
    //echo $e->errorMessage();
     //$_SESSION['iletisim_uyari'] = $e->errorMessage(); //'Hata ! Mesajınız Ulaşmadı Lütfen Doğrudan Mail Gönderin';
    //header(&quot;Location:$geldigi_yer&quot;);
    //exit();
     }
    İlgin için teşekkür ederim. Bu kodları bilgisayarıma aldım. Daha sonra lazım olduğunda kullanacağım. Hosting firmamla görüşüp mail fonksiyonunu aktif ettirdim ve direkt mail fonksiyonu ile işlem yapıyorum.