Created
February 19, 2019 19:40
-
-
Save anselmobattisti/eb2a5891a3172cf177b80defde7ff7bd to your computer and use it in GitHub Desktop.
send email using joomla
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Invoke JMail Class | |
$mailer = JFactory::getMailer(); | |
# Set sender array so that my name will show up neatly in your inbox | |
$mailer->setSender($data[‘mailfrom’]); | |
# Add a recipient — this can be a single address (string) or an array of addresses | |
$mailer->addRecipient($user->email); | |
$mailer->setSubject(utf8_decode($subject)); | |
$mailer->setBody($body); | |
# If you would like to send as HTML, include this line; otherwise, leave it out | |
$mailer->isHTML(); | |
# Send once you have set all of your options | |
$return = $mailer->send(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment