Joomla uses PHPMailer as mail handler. PHPMailer has a nice SMTP log if you turn it on. You can do this by setting the SMTPDebug variable to true
$mailer = JFactory::getMailer();
$mailer->SMTPDebug = true;
As you can see on the API reference page, the sendMail() function has a $bcc parameter:
sendMail(string $from, string $fromName, mixed $recipient, string $subject, string $body, boolean $mode = false, mixed $cc = null, mixed $bcc = null, mixed $attachment = null, mixed $replyTo = null, mixed $replyToName = null)
Also, if you're sending the same email to ...
If it were me, I'd do this:
Sign up for Mandrill (made by the MailChimp people). You get the first 12,000 message for free. Sign up here: https://mandrill.com
Get the CMandrill component from CompoJoom for free. Get it here: CMandrill
Follow all the CMandrill instructions.
It bypasses the entire Joomla mail system and sends everything through Mandrill. At ...
There are 2 solutions you can try of the following.
By avoiding the mailer instance : $mailerand using the following code -
JFactory::getMailer()->sendMail($emailfrom, $sitename, 'email@example.com', $subject, $message, 1);
JFactory::getMailer()->sendMail($emailfrom, $sitename, 'firstname.lastname@example.org', $subject, $...
To use JMailer it is pretty simple. The code below should work for you. Just change the appropriate email address and name sections to get it to work.
$subject = "New User Signup";
$msg = "New user";
$to = "email@example.com";
$from = array("YOUR_EMAIL@YOURDOMAIN.COM", "YOUR NAME");
$mailer = JFactory::getMailer();
setSubject() is a function that belongs to the JMail class, not UsersController.
So assuming you want to set the subject for your email, you can use the following:
For more information on Joomla's mail feature, have a read of the following:
Hope this helps
Here is a hypothesis based on what I seen in the source code.
I don't see anything that looks like there is any problem with adding the recipient. Are you using SMTP? With SMTP you can use the variable $mail->SMTPDebug = true This should echo the request if made via SMTP.
Either way PHPMailer (what joomla uses) loops through the recipients and sends ...
You can get file input data with this:
$files = $input->files->get('inputName');
You don't have to use JRegistry and then json_decode it. You will get array from $jinput->post->getArray() in first place.
So your code could be
$jinput = JFactory::getApplication()->input;
$formData = $jinput->post->getArray();
$arrayOfFields = array();
This encoding is designed to make binary data survive transport through transport layers that are not 8-bit clean, such as mail bodies.
Base64-encoded data takes about 33% more space than the original data.
$str = 'This is an encoded string';
Here is a general idea.
You need to maintain a table which holds the templates for the emails you need to send and additionally to store the language name as well:
type email_text lang
register Hello world! en-GB
register Ciao mondo it-IT
Detect user language.
$user = JFactory::getUser();
I found the resolution. It turns out my inherited exchange server was configured incorrectly. For those of you who may experience the same issue, here's what I did to fix it in exchange 2016.
In exchange, select Mail Flow > Receive Connectors and create a new one.
For this instance, instead of allowing all sources to send to the exchange server, you will ...
So here is the code that works :
//preparation et envoi du mail
//provenance du mail
$sender = array('myEmailAddress','myName');
//destibnataires du mail
$m->addRecipient($to); //an array of emails
//sujet du message
//encodage du mail
What joomla version you are using?
In older version of joomla the later part of the code (second chunk) might not work.
And again for the code,
$mailer->addAttachment(JPATH_COMPONENT . DS . 'assets' . DS . 'php' . DS . 'files' . DS . $values['carte']);
Try to use
$mailer->addAttachment(JPATH_COMPONENT . '/assets/php/files/'.$values['carte']);