Hot answers tagged

8

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; $mailer->setSender($settings->sender); $mailer->addRecipient($settings->to); $mailer->setSubject($settings->subject); $mailer->...


7

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 ...


6

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 ...


3

There are 2 solutions you can try of the following. By avoiding the mailer instance : $mailerand using the following code - JFactory::getMailer() JFactory::getMailer()->sendMail($emailfrom, $sitename, 'adam@malinator.com', $subject, $message, 1); JFactory::getMailer()->sendMail($emailfrom, $sitename, 'a.fini@ambulatoriprivati.it', $subject, $...


3

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 = "my_mail@hotmail.com"; $from = array("YOUR_EMAIL@YOURDOMAIN.COM", "YOUR NAME"); $mailer = JFactory::getMailer(); $mailer->setSender($from); $mailer-...


3

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: $mailer->setSubject('Subject Here'); For more information on Joomla's mail feature, have a read of the following: http://docs.joomla.org/Sending_email_from_extensions Hope this helps


3

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 ...


2

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(); ...


2

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. Example: <?php $str = 'This is an encoded string'; echo base64_encode($str); ?> Result: VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw== Source: ...


2

You just need to decode the entities before passing it to the email. Something like: $html = html_entity_decode($emailBody); or better still $html = html_entity_decode($emailBody, ENT_QUOTES);


2

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(); $...


2

Ah, I've found it: AddCustomHeader(). Output looks OK like this: $body = "Some content"; $mail = JFactory::getMailer(); $mail->addRecipient("recipient@example.com"); $mail->setBody($body); $mail->setSender(array("sender@example.com", "John Doe")); $mail->setSubject("My Subject"); $data = array( "options" => array("transactional" => "true") ...


1

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 ...


1

So here is the code that works : //preparation et envoi du mail $m=JFactory::getMailer(); //provenance du mail $sender = array('myEmailAddress','myName'); $m->setSender($sender); //destibnataires du mail $m->addRecipient($to); //an array of emails //sujet du message $m->setSubject($subject); //encodage du mail $m->isHTML(true); $m->...


1

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']); ...


Only top voted, non community-wiki answers of a minimum length are eligible