Jump to content
Forumu Destekleyenlere Katılın ×
Paticik Forumları
2000 lerden beri faal olan, çok şukela bir paylaşım platformuyuz. Hoşgeldiniz.

Smtp authentication ayarı yapabilecek (php)


Öne çıkan mesajlar

Mesaj tarihi:
Merhaba
Natro ile çalışıyorum ve hostingleri mail gönderirken authentication zorunlu kılıyormuş fakat ben magento üzerinden hiçbir mail fonksiyonunu kullanamıyorum.Bana phpmailer dosyası yolladılar fakat nasıl entegre edeceğim hakkında hiçbir fikrim yok.Php konusunda uzman varsa yardım edebilirmi
Mesaj tarihi:
phpmailer dosyasını biyere koycaksın

sonra

require_once "phpmailer.php";

$from = "Sandra Sender ";
$to = "Ramona Recipient ";
$subject = "Hi!";
$body = "Hi,nnHow are you?";

$host = "mail.example.com";
$username = "smtp_username";
$password = "smtp_password";

$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
echo("

" . $mail->getMessage() . "

");
} else {
echo("

Message successfully sent!

");
}
?>

Sending Mail from PHP Using SMTP Authentication and SSL Encryption - Example

require_once "phpmailer.php";

$from = "Sandra Sender ";
$to = "Ramona Recipient ";
$subject = "Hi!";
$body = "Hi,nnHow are you?";

$host = "ssl://mail.example.com";
$port = "465";
$username = "smtp_username";
$password = "smtp_password";

$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
echo("

" . $mail->getMessage() . "

");
} else {
echo("

Message successfully sent!

");
}
?>
buadar
Mesaj tarihi:
ohho php den forma düştük
formdan verileri postla veya getla alıcaksın
atıyorum






die bi sayfan var adam butona basınca
post_edicen_php_dosayasi.php dosyana adamin girdigi bilgileri yollucaksın
çekerken
$name = $_POST['name'];
$email= $_POST['email'];

bilgileri aldıktan sonra yukardaki phpmailer dosyasını cagrııcaksın; required_once("artık dosyan nerdeyse/phpmailer.php");
sonrabilgileri doldurcaksın
okadar ver bilen birine yapsın anlamıosan nie kasıonki:p
Mesaj tarihi:
bugun keyfim acaip yerinde, sana aksam eve dondugumde basic bir form yazip yollicam buradan :) 12 de hala gondermemeis olursam pm atip hatirlat :)
Mesaj tarihi:
Memphis7 said:

serverdan atıcaksan
localhost
ve 25 portu kullancan sanırım eminde deilim tunayım


Default port 25 de Telekom 25 portunu engellemişti sanırım. 366 kullandırıyolar.
Mesaj tarihi:
simdi asagidaki kodu kullanabilmen icin PEAR Mail package sisteminde kurulu olmali, deb tabanli bir linux sistemi ise sadece sunu root olarak yazman yeterli;

apt-get install php-mail

kod asagida, temel olarak, body, to, subject fieldlari olan bir web form. Aldigi datayi hic bir kontrol yapmadan, mail sunucusu uzerinden gonderiyor.


<?
$add=$_POST['send'];
if($add)
{
require_once "Mail.php";
$mail = $_POST['mail'];
$subject = $_POST['subject'];
$body = $_POST['body'];
$from = "[email protected]";
$to = $mail;
$host = "ssl://smtp.gmail.com";
$port = "495";
$username = "myusername";
$password = "mypassword";
$headers = array ('From' => '$from', 'To' => $mail, 'Subject' => $subject);
$smtp = Mail::factory('smtp', array ('host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password));
$mail = $smtp->send($mail, $headers, $body);
if (PEAR::isError($mail))
{
echo "error";
}
else
{
echo "done";
}
}
?>
<html>
<head>
<title>mail gonderici</title>
</head>
<body>
<form name=mailForm method=post>
Mail: <input type=email name=mail><br/>
Konu: <input type=text name=subject></br>
Mesaj: <input type=textarea name=body cols=30 rows=8></br>
<input type=hidden name=send value=1>
<input type=submit value=Gonder>
</form>
</body>
</html>
×
×
  • Yeni Oluştur...