PHP Classes

File: smtp_gmail.php

Recommend this page to a friend!
  Classes of Manuel Lemos   MIME E-mail message sending   smtp_gmail.php   Download  
File: smtp_gmail.php
Role: Example script
Content type: text/plain
Description: Wrapper script that provides the gmail_smtp_mail function to replace the mail function and send messages via the Gmail SMTP server
Class: MIME E-mail message sending
PHP mailer to compose and send MIME messages
Author: By
Last change:
Date: 2 years ago
Size: 1,051 bytes
 

Contents

Class file image Download
<?php
/*
 * smtp_gmail.php
 *
 * @(#) $Id: smtp_gmail.php,v 1.1 2022/10/21 08:28:33 mlemos Exp $
 *
 *
 */

   
require_once("email_message.php");
    require_once(
"smtp_message.php");
    require_once(
"smtp.php");
    require(
"sasl.php");

   
$message_object=new smtp_message_class;
   
$message_object->localhost="localhost"; /* This computer address */
   
$message_object->smtp_port = 587; /* This is the SMTP port */
   
$message_object->smtp_host="smtp.gmail.com"; /* SMTP server address */
   
$message_object->smtp_start_tls = true; /* Make SMTP dialog use TLS security */
   
$message_object->smtp_debug=0; /* Output dialog with SMTP server */
   
$message_object->smtp_html_debug=1; /* If smtp_debug is 1, set this to 1 to output debug information in HTML */

Function gmail_smtp_mail($to,$subject,$message,$additional_headers="",$additional_parameters="")
{
    global
$message_object;

    return(
$message_object->Mail($to,$subject,$message,$additional_headers,$additional_parameters));
}

?>