Skip to content

Instantly share code, notes, and snippets.

View Criptos's full-sized avatar

ANDRES TELLO Criptos

View GitHub Profile
@Criptos
Criptos / mailprocessor.php
Last active October 25, 2020 18:59
Function to send html mail. It reads the body and converts images to base64 inline attachments. It appends a header and foother. You can also send additional inline attachments via $attachments and it has ical support.
<?php
function sendmail($to, $from $subject, $body, $preheader=false, $attachments=false, $noDom=false, $dstName=false, $url){
$obj = new stdClass();
//Create a new PHPMailer instance
$mail = new PHPMailer;
$msg="";
$mail->SMTPSecure = "tls";
$mail->IsSMTP();
$mail->Host = "smtp.gmail.com";