$to = "john@example.com"; $subject = "Welcome to our website"; $body = "Dear John, Thank you for joining our website. We hope you enjoy using our platform. Best Regards, The Team"; $mail = new PHPMailer; $mail->AddAddress($to); $mail->Subject = $subject; $mail->Body = $body; $mail->Send();
$to = "jane@example.com"; $subject = "New product launch"; $body = "In this example, we are sending an HTML email with an image. We use the setBody function to set the HTML code as the body of the email. We also use the isHTML function to indicate that we are sending an HTML email. The package library used in these examples is PHPMailer, a popular email sending library for PHP.New Product Launch
Dear Jane, Our company is excited to announce the launch of our latest product line. Check our website for more information.
"; $mail = new PHPMailer; $mail->AddAddress($to); $mail->Subject = $subject; $mail->isHTML(true); $mail->Body = $body; $mail->Send();