Support > Technical support

Can elxis send html emails?

(1/2) > >>

michalis1984:
Hello,

Can I use elxis sendmail function to send HTML emails? And if yes how?

Blacksoll:
With newsletter module it can!
https://www.elxis.net/edc/communication/61.html

michalis1984:
I was looking for the class but i find it


--- Code: ---$elxis->sendmail($subject, $body, '', null, 'html', $to, null, null, $from, 3, false, $replyto);
--- End code ---

datahell:
Elxis can send any type of email you want. Plain text, html, both plain/html, with attachments, mass mail, and more.

You found the correct function, I type it once more for clarification:
sendmail($subject, $body, $alt_body='', $attachment=null, $type='plain', $to=null, $cc=null, $bcc=null, $from=null, $priority=3, $debug=false, $replyto=null)

So, to send html email:
$elxis->sendmail('My subject', $html_text, $optional_plain_text, null, 'html', 'test@example.com');

Tip: The additional plain text message is used when the email client doesn't want or doesn't support html emails. So in this case he will see the plain text message instead. If you ommit it he will see the html one without the html format which most probably will look ugly. So it is a good practice to include an alternative plain text message when sending html emails.

Ask you have any questions regarding the function parameters.

michalis1984:
Thank you datahell! The tip is very useful.

I want to learn more about the $attachment parameter.

What if I want to attach an image or a pdf file at the email (which is already uploaded)? How do I use that parameter? Full URL or any special elxis internal link?

Navigation

[0] Message Index

[#] Next page

Go to full version