Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[0.8.4] send emails through SMTP working with Gmail
#1
here is my source file from my functions_email.php file! just fill in your details where designated to!

Find "function sendmail()" and highlight everything under it and just copy and past this over your old code if its version 0.8.4 other versions im not sure about!

Code:
function sendmail()
{

include("class.phpmailer.php");
include("class.smtp.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtp.gmail.com"; // your SMTP address
$mail->SMTPSecure = "ssl";  
$mail->Port       = 465;
$mail->SMTPAuth = TRUE; // turn on SMTP authentication -- generally needed for most SMTP servers
$mail->Username = "your [email protected]"; // your SMTP username
$mail->Password = "password"; // your SMTP password

$mail->IsHTML(true);
$mail->From="your [email protected]"; // your email address
$mail->FromName="from who?"; // Front name you want to use
$mail->Subject = ($this->subject);
$mail->Body = ($this->message);

if (is_array($this->to))
{
for ($i = 0; $i < count($this->to); $i++)
{
$mail->AddAddress($this->to[$i]);
$mail->Send();
}
}
else
{
$mail->AddAddress($this->to);
$mail->Send();
}
}
    
    function email_basic($subject, $to, $message, $from = '')
    {
        $this->to = $to;
        $this->subject = $subject;
        $this->from = $from;
        $this->message = $message;
        $this->build_header();
        $this->sendmail();
    }
    
    function email_sender($to, $file, $subject)
    {
        $this->to = $to;
        $this->subject = $subject;
        $this->build_header();
        $this->buildmessage($file);
        $this->sendmail();
    }
}
?>

Now just upload the files from the attachment into the root of your includes folder.

.zip   _lib.zip (Size: 80.67 KB / Downloads: 0)

To get your Gmail SMTP Settings....

Quote:1. login to your gmail account

2. top right corner click on settings

3. select the tab "Forwarding and POP/IMAP"

4. enable POP

5. visit this link and find the settings needed! https://support.google.com/mail/troubles...68960?rd=1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)

Rommie