PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of YoungHyeong Ryu   PHP Send Mail Class   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: sample
Class: PHP Send Mail Class
Send email messages with attachments via SMTP
Author: By
Last change:
Date: 9 years ago
Size: 1,269 bytes
 

Contents

Class file image Download
<?php
header
("Content-Type: text/html; charset=utf-8");
error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors', On);


include_once
'class.sendmail.php';
$sendmail = new SendMail();

// Set Smtp Infomation as you using _SMTPSend
$sendmail->UseSMTPServer = true; //If you use smtp sert set true, or local php mail function set false
$sendmail->SMTPServer = "SMTP SERVER";
$sendmail->SMTPPort = "SMTP PORT";
$sendmail->SMTPAuthUser = "SMTP AUTH ID";
$sendmail->SMTPAuthPasswd = "SMTP AUTH PASSWORD";
    
$sendmail->charset = 'utf-8';//ecu-kr :korean, iso-2022-jp : japaneses
$sendmail->Subject ("String Subject");
$sendmail->ReplyTo ("String Username<mailAccount@domain>");
$sendmail->From ("String Username<mailAccount@domain>");
$sendmail->To (preg_split("/[;,]+/", "a@domain;b@domain;c@domain"));
$sendmail->Cc (preg_split("/[;,]+/", "cc@domain"));
$sendmail->Bcc (preg_split("/[;,]+/", "bcc@domain"));
$sendmail->Priority (3);


##$sendmail->SetAttach($_FILES["input_file"]);//send file from form file type
$attached = explode(",", "filname1,filename2");//link of file uploaded already
$sendmail->SetAttachPath($attached, "filepath");//

$sendmail->Body ("String Mail Body");

$sendmail->Send();//Send mail