WHM 2086 English » Articles

Send Email From PHP Using SMTP Authentication

Geri git   WHM cPanel Destek Platformu » WHMSupport .Com - WHM/cPanel English Support Platform » WHM 2086 English » Articles
Kayıt ol Yardım Üye Listesi Ajanda Forumları Okundu Kabul Et
 

Cevapla
 
LinkBack Seçenekler Stil
  #1 (permalink)  
Alt 15.11.07, 11:20 PM
WHMSonic - ait Kullanıcı Resmi (Avatar)
WHM Developer
 
Üyelik tarihi: Nov 2007
Mesajlar: 91
Tecrübe Puanı: 31
WHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond repute
Thumbs up Send Email From PHP Using SMTP Authentication

Hello,
This is useful article. In this article I am showing how to send email from PHP using SMTP Authentication for WHM/cPanel Servers.

Everybody knows that normal php mail functions sending emails as a nobody and this is cause to spam emails. Now check my amazing solution

Login to your root SSH and copy/use following command line to your SSH line.
PHP- Kodu:
pear install Mail;pear install Net_SMTP;pear install Auth_SASL
After above command, you can now use the following php script and send real emails.

PHP- Kodu:
<?php
require_once "Mail.php";
$from "MyName <name@myemail.com>";
$to "TargetName <name@targetemail.com>";
$subject "Hi!";
$body "Hi,\n\nHow are you?";
$host "mail.mailserver.com";
$username "name@myemail.com";
$password "my_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(
"<p>" $mail->getMessage() . "</p>");
 } else {
  echo(
"<p>Message successfully sent!</p>");
 }
?>
__________________
Regards,
We Develop The Future
The Revolution Of WHM/cPanel Plugins ( Automatic ShoutCast & IRC )
www.whmsonic.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Alıntı ile Cevapla
  #2 (permalink)  
Alt 25.11.07, 08:01 PM
tespara - ait Kullanıcı Resmi (Avatar)
Gamzede
 
Üyelik tarihi: Jun 2007
Nerden: dersaadet
Mesajlar: 67
Tecrübe Puanı: 42
tespara has a reputation beyond reputetespara has a reputation beyond reputetespara has a reputation beyond reputetespara has a reputation beyond reputetespara has a reputation beyond reputetespara has a reputation beyond reputetespara has a reputation beyond reputetespara has a reputation beyond reputetespara has a reputation beyond reputetespara has a reputation beyond reputetespara has a reputation beyond repute
tespara - MSN üzeri Mesaj gönder tespara isimli Üyeye Skype üzeri Mesaj gönder
thanx WHMSonic

i do not know where mail.php which have been defined class ' (how can i call class in line 13?)
__________________
Çok kaygı çekme, mukadder olan olur, takdir olunan rızkın da sana gelir.[Hz Muhammed (S.A.V)]
Şiir vardır ki, hikmettir. Beyân vardır ki, büyüdür.[Hz Muhammed (S.A.V)]
Kim, bir zümreye benzemeye çalışırsa, o, onlardandır.[Hz Muhammed (S.A.V)]
Hikmetin başı, Allah korkusudur.[Hz Muhammed (S.A.V)]
Elif Lam Mim. İnsanlar "inandık" deyip kurutlacaklarınımı sanırlar [Ankebut ,1]

Konu tespara tarafından (25.11.07 Saat 10:02 PM ) değiştirilmiştir..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Alıntı ile Cevapla
  #3 (permalink)  
Alt 26.11.07, 12:26 PM
sinangunay - ait Kullanıcı Resmi (Avatar)
FULL DESTEK SUNUCULAR
 
Üyelik tarihi: Jul 2007
Nerden: biLi biLi boP
Yaş: 27
Mesajlar: 1.621
Tecrübe Puanı: 1072
sinangunay has a reputation beyond reputesinangunay has a reputation beyond reputesinangunay has a reputation beyond reputesinangunay has a reputation beyond reputesinangunay has a reputation beyond reputesinangunay has a reputation beyond reputesinangunay has a reputation beyond reputesinangunay has a reputation beyond reputesinangunay has a reputation beyond reputesinangunay has a reputation beyond reputesinangunay has a reputation beyond repute
Hallo, danke schön für der Artikel.
__________________
KROYUM AMMA SİSTEM BİLGİSİ BENDE
KAMYON ÇEKER 10-20 TON, GÖNLÜM ÇEKER PARİS HİLTON

RAHMETLİ DE HACKLERDİ
TEK RAKİBİM SUN MICROSYSTEMS
SOLLAMA BENİ, FORMATLARIM SENİ


HAZİRAN AYININ 2SİNE KADAR SINAVLAR NEDENİYLE YOKUM YARDIMCI OLAMADIĞIM İÇİN ÖZÜR DİLERİM

-----------------------------------------------------------------------------------------

>> LÜTFEN ÜCRETSİZ DESTEK TALEP ETMEK İÇİN MSN ADRESLERİMİZİ EKLEMEYİNİZ. HER TÜRLÜ ÜCRETSİZ DESTEK İÇİN FORUMLARIMIZI KULLANINIZ. TEŞEKKÜRLER <<
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Alıntı ile Cevapla
  #4 (permalink)  
Alt 27.11.07, 12:04 AM
WHMSonic - ait Kullanıcı Resmi (Avatar)
WHM Developer
 
Üyelik tarihi: Nov 2007
Mesajlar: 91
Tecrübe Puanı: 31
WHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond reputeWHMSonic has a reputation beyond repute
Alıntı:
tespara´isimli üyeden Alıntı Mesajı göster
thanx WHMSonic

i do not know where mail.php which have been defined class ' (how can i call class in line 13?)
Hello,
Mail.php is server side pear, but you may download this and see the full class:
http://download.pear.php.net/package/Mail-1.1.13.tgz

More information: http://pear.php.net/package/Mail
__________________
Regards,
We Develop The Future
The Revolution Of WHM/cPanel Plugins ( Automatic ShoutCast & IRC )
www.whmsonic.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Alıntı ile Cevapla
  #5 (permalink)  
Alt 30.05.08, 12:15 AM
WHM VIP Member
 
Üyelik tarihi: Feb 2008
Nerden: İzmir
Yaş: 24
Mesajlar: 351
Tecrübe Puanı: 1001
darkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond repute
Hello,

I got these errors, are these about PHP' s disable_functions ?

Thanks..

Regards..

Alıntı:
login as: root
root@72.21.49.170's password:
Last login: Thu May 29 02:02:57 2008 from
[root@whmdestek ~]# pear install Mail;pear install Net_SMTP;pear install Auth_SASL;
WARNING: channel "pear.php.net" has updated its protocols, use "channel-update p ear.php.net" to update
Did not download dependencies: pear/Net_SMTP, use --alldeps or --onlyreqdeps to download automatically

Warning: popen() has been disabled for security reasons in OS/Guess.php on line 247

Warning: popen() has been disabled for security reasons in /usr/local/lib/php/OS /Guess.php on line 247

Warning: fgets(): supplied argument is not a valid stream resource in OS/Guess.p hp on line 248

Warning: fgets(): supplied argument is not a valid stream resource in /usr/local /lib/php/OS/Guess.php on line 248

Warning: pclose(): supplied argument is not a valid stream resource in OS/Guess. php on line 256

Warning: pclose(): supplied argument is not a valid stream resource in /usr/loca l/lib/php/OS/Guess.php on line 256
pear/Mail can optionally use package "pear/Net_SMTP" (version >= 1.1.0)
downloading Mail-1.1.14.tgz ...
Starting to download Mail-1.1.14.tgz (17,537 bytes)
......done: 17,537 bytes
install ok: channel://pear.php.net/Mail-1.1.14
WARNING: channel "pear.php.net" has updated its protocols, use "channel-update p ear.php.net" to update
Did not download optional dependencies: pear/Auth_SASL, use --alldeps to downloa d automatically

Warning: popen() has been disabled for security reasons in OS/Guess.php on line 247

Warning: popen() has been disabled for security reasons in /usr/local/lib/php/OS /Guess.php on line 247

Warning: fgets(): supplied argument is not a valid stream resource in OS/Guess.p hp on line 248

Warning: fgets(): supplied argument is not a valid stream resource in /usr/local /lib/php/OS/Guess.php on line 248

Warning: pclose(): supplied argument is not a valid stream resource in OS/Guess. php on line 256

Warning: pclose(): supplied argument is not a valid stream resource in /usr/loca l/lib/php/OS/Guess.php on line 256
pear/Net_SMTP can optionally use package "pear/Auth_SASL"
downloading Net_SMTP-1.3.0.tgz ...
Starting to download Net_SMTP-1.3.0.tgz (10,259 bytes)
.....done: 10,259 bytes
downloading Net_Socket-1.0.8.tgz ...
Starting to download Net_Socket-1.0.8.tgz (5,441 bytes)
...done: 5,441 bytes
install ok: channel://pear.php.net/Net_Socket-1.0.8
install ok: channel://pear.php.net/Net_SMTP-1.3.0
WARNING: channel "pear.php.net" has updated its protocols, use "channel-update p ear.php.net" to update

Warning: popen() has been disabled for security reasons in OS/Guess.php on line 247

Warning: popen() has been disabled for security reasons in /usr/local/lib/php/OS /Guess.php on line 247

Warning: fgets(): supplied argument is not a valid stream resource in OS/Guess.p hp on line 248

Warning: fgets(): supplied argument is not a valid stream resource in /usr/local /lib/php/OS/Guess.php on line 248

Warning: pclose(): supplied argument is not a valid stream resource in OS/Guess. php on line 256

Warning: pclose(): supplied argument is not a valid stream resource in /usr/loca l/lib/php/OS/Guess.php on line 256
downloading Auth_SASL-1.0.2.tgz ...
Starting to download Auth_SASL-1.0.2.tgz (5,645 bytes)
.....done: 5,645 bytes
install ok: channel://pear.php.net/Auth_SASL-1.0.2
__________________
From hell 2 heaven..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Alıntı ile Cevapla
  #6 (permalink)  
Alt 29.06.08, 09:27 AM
Banned
 
Üyelik tarihi: Jun 2008
Mesajlar: 8
Tecrübe Puanı: 0
shelliminternet is on a distinguished road
nolmus ne diyo
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Alıntı ile Cevapla
  #7 (permalink)  
Alt 29.06.08, 11:10 AM
WHM VIP Member
 
Üyelik tarihi: Feb 2008
Nerden: İzmir
Yaş: 24
Mesajlar: 351
Tecrübe Puanı: 1001
darkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond reputedarkwinter has a reputation beyond repute
This is English forum so If you wanna know about something; you must ask in English.
__________________
From hell 2 heaven..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Alıntı ile Cevapla
Cevapla

« - | - »


Seçenekler
Stil

Yetkileriniz
Yeni Mesaj yazma yetkiniz aktif değil dir.
Mesajlara Cevap verme yetkiniz aktif değil dir.
Eklenti ekleme yetkiniz aktif değil dir.
Kendi Mesajınızı değiştirme yetkiniz aktif değil dir.

Smileler Açık
[IMG] Kodları Açık
HTML-KodlarıKapalı
Trackbacks are Açık
Pingbacks are Açık
Refbacks are Açık