Teknoloji Haberleri
DH
forum
mini
Uygulama ile
aç
Uygulama ile Aç
Giriş
Kayıt
DH Anasayfa
İndirim Kodu
Ara
Popüler
Foruma Git
Hakkımızda
Destek
Mobil Sürüm
Standart Site Görünümü
Bu Konuda
Tüm Forumlar
Web Tasarım - Programlama
Yazılım Geliştirme
PHP / CGI
Bu Konuda
Bağlan:
Facebook
Google+
Twitter
Aşağı Git
Tüm Forumlar
Web Tasarım - Programlama
Yazılım Geliştirme
PHP / CGI
PHP SMTP SORUNU
Bu konudaki kullanıcılar: 1 misafir, 1 mobil kullanıcı
0
Cevap
168
Tıklama
0
Öne Çıkarma
1. sayfa
PHP SMTP SORUNU
Cevap Yaz
Konuya Özel
Linkli Mesajlar
Seçkin Yorumlar
D
doguazad
Cevapla
Özel Mesaj
Şikayet
Mesaja Link
Takip Et
3 yıl
Er
Konu Sahibi
merhaba php ile formdan gelen verileri smtp olarak göndermek istiyoruma ama hata alıyorum. Sorunu nasıl çözebilirim
< Resime gitmek için tıklayın >
include
"
class.phpmailer.php
"
;
include
"
class.smtp.php
"
;
$isim
=
$_POST
[
'
isim_soyisim
'
];
$telefon
=
$_POST
[
'
telefon
'
];
$mail
=
$_POST
[
'
mail
'
];
$adres
=
$_POST
[
'
acik_adres
'
];
$il
=
$_POST
[
'
il
'
];
$ilce
=
$_POST
[
'
ilce
'
];
$mahalle
=
$_POST
[
'
mahalle
'
];
$cadde
=
$_POST
[
'
sokak
'
];
$ada
=
$_POST
[
'
ada
'
];
$parsel
=
$_POST
[
'
parsel
'
];
$tesisat_turleri
=
$_POST
[
'
tesisat_tur
'
];
$tuketici_sinif
=
$_POST
[
'
sinif
'
];
$cati_alani
=
$_POST
[
'
cati
'
];
//$son_e_fatura = $_POST['son_fatura'];
//$tapu = $_POST['tapu'];
/*
$foto1 = $_POST['fotobir'];
$foto2 = $_POST['fotoiki'];
$foto3 = $_POST['fotouc'];
$foto4 = $_POST['fotodort'];
$foto5 = $_POST['fotobes'];*/
$jsonil
=
$il
;
$jsonilce
=
$ilce
;
$jsonmahalle
=
$mahalle
;
$jsoncadde
=
$cadde
;
$datail
=
json_decode
(
$jsonil
);
$yeniil
=
$datail
->
value
;
$datailce
=
json_decode
(
$jsonilce
);
$yeniilce
=
$datailce
->
value
;
$datamahalle
=
json_decode
(
$jsonmahalle
);
$yenimahalle
=
$datamahalle
->
value
;
$datacadde
=
json_decode
(
$jsoncadde
);
$yenicadde
=
$datacadde
->
value
;
// echo $yeniil;
// echo $yeniilce;
// echo $yenimahalle;
// echo $yenicadde;
$mail
=
new
PHPMailer
();
$mail
->
IsSMTP
();
// enable SMTP
$mail
->
SMTPDebug
=
1
;
// debugging: 1 = errors and messages, 2 = messages only
$mail
->
SMTPAuth
=
true
;
// authentication enabled
$mail
->
SMTPSecure
=
'
TLS
'
;
// secure transfer enabled REQUIRED for Gmail
$mail
->
Host
=
"
smtp.yandex.com
"
;
$mail
->
Port
=
465
;
// or 587
$mail
->
IsHTML
(
true
);
$mail
->
Username
=
"
lastdigitalhelp@yandex.com
"
;
$mail
->
Password
=
"
fkbm2394
"
;
$mail
->
SetFrom
(
"
azrodo211@protonmail.ch
"
);
$mail
->
Subject
=
"
Test
"
;
$mail
->
Body
=
"
hello
"
;
$mail
->
AddAddress
(
"
azrodo21@gmail.comm
"
);
if
(
!
$mail
->
Send
())
{
echo
"
Mailer Error:
"
.
$mail
->
ErrorInfo
;
}
else
{
echo
"
Message has been sent
"
;
}
?>
1. sayfa
Hizmet kalitesi için çerezleri kullanabiliriz, DH'yi kullanırken depoladığımız çerezlerle ilgili
veri politikamıza
gözatın.
< Resime gitmek için tıklayın >
include "class.phpmailer.php";
include "class.smtp.php";
$isim = $_POST['isim_soyisim'];
$telefon = $_POST['telefon'];
$mail = $_POST['mail'];
$adres = $_POST['acik_adres'];
$il = $_POST['il'];
$ilce = $_POST['ilce'];
$mahalle = $_POST['mahalle'];
$cadde = $_POST['sokak'];
$ada = $_POST['ada'];
$parsel = $_POST['parsel'];
$tesisat_turleri = $_POST['tesisat_tur'];
$tuketici_sinif = $_POST['sinif'];
$cati_alani = $_POST['cati'];
//$son_e_fatura = $_POST['son_fatura'];
//$tapu = $_POST['tapu'];
/*
$foto1 = $_POST['fotobir'];
$foto2 = $_POST['fotoiki'];
$foto3 = $_POST['fotouc'];
$foto4 = $_POST['fotodort'];
$foto5 = $_POST['fotobes'];*/
$jsonil = $il;
$jsonilce = $ilce;
$jsonmahalle = $mahalle;
$jsoncadde = $cadde;
$datail = json_decode($jsonil);
$yeniil= $datail->value;
$datailce = json_decode($jsonilce);
$yeniilce = $datailce->value;
$datamahalle = json_decode($jsonmahalle);
$yenimahalle = $datamahalle->value;
$datacadde = json_decode($jsoncadde);
$yenicadde = $datacadde->value;
// echo $yeniil;
// echo $yeniilce;
// echo $yenimahalle;
// echo $yenicadde;
$mail = new PHPMailer();
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'TLS'; // secure transfer enabled REQUIRED for Gmail
$mail->Host = "smtp.yandex.com";
$mail->Port = 465; // or 587
$mail->IsHTML(true);
$mail->Username = "lastdigitalhelp@yandex.com";
$mail->Password = "fkbm2394";
$mail->SetFrom("azrodo211@protonmail.ch");
$mail->Subject = "Test";
$mail->Body = "hello";
$mail->AddAddress("azrodo21@gmail.comm");
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message has been sent";
}
?>