Tekil Mesaj gösterimi
  #1 (permalink)  
Alt 15.11.07, 11:20 PM
WHMSonic - ait Kullanıcı Resmi (Avatar)
WHMSonic WHMSonic isimli Üye şimdilik offline konumundadır
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
Alıntı ile Cevapla