Send email with dedicated SMTP settings from a Craft 2 plugin I have looked a lot for this but cannot find any dedicated solution. Basically I want to do this: How to send email from Craft 3 custom plugin? … but for a Craft 2 plugin.

A how-to for the global email settings would be already helpful, but ideally we would like to use not those SMTP settings in the global email settings but dedicated ones for another email address. Can this be done?

Thanks!

edit August 8th: no ideas? Any help is welcome!
So basically I solved it like this, but couldn’t apply other SMTP settings than the global ones. But we did a workaround with the replyTo-address, so practically we are fine. If someone knows how to apply other SMTP-settings, feel free to answer. Thanks!

namespace Craft;
$email = new EmailModel();
$emailSettings = craft()-&gt;email-&gt;getSettings();

$email-&gt;toEmail   = $_REQUEST['email'];
$email-&gt;replyTo = 'test@test.com';
$email-&gt;subject = "Subject";    
$message = "...";

$email-&gt;body = $message;

craft()-&gt;email-&gt;sendEmail($email);