Skip to main content
added 6 characters in body
Source Link
Brad Bell
  • 67.6k
  • 6
  • 75
  • 145

I don't think I'm following the 2nd half of your post, but a simple example of sending an email in Craft 2 looks like this:

$emailModel = new EmailModelCraft\EmailModel();

$emailModel->subject = 'My Subject';
$emailModel->body = 'My Body';
$emailModel->htmlBody = '<html><body>My HTML Body</body></html>';
$emailModel->toEmail = '[email protected]';

craft()->email->sendEmail($emailModel);

I don't think I'm following the 2nd half of your post, but a simple example of sending an email in Craft 2 looks like this:

$emailModel = new EmailModel();

$emailModel->subject = 'My Subject';
$emailModel->body = 'My Body';
$emailModel->htmlBody = '<html><body>My HTML Body</body></html>';
$emailModel->toEmail = '[email protected]';

craft()->email->sendEmail($emailModel);

I don't think I'm following the 2nd half of your post, but a simple example of sending an email in Craft 2 looks like this:

$emailModel = new Craft\EmailModel();

$emailModel->subject = 'My Subject';
$emailModel->body = 'My Body';
$emailModel->htmlBody = '<html><body>My HTML Body</body></html>';
$emailModel->toEmail = '[email protected]';

craft()->email->sendEmail($emailModel);
Source Link
Brad Bell
  • 67.6k
  • 6
  • 75
  • 145

I don't think I'm following the 2nd half of your post, but a simple example of sending an email in Craft 2 looks like this:

$emailModel = new EmailModel();

$emailModel->subject = 'My Subject';
$emailModel->body = 'My Body';
$emailModel->htmlBody = '<html><body>My HTML Body</body></html>';
$emailModel->toEmail = '[email protected]';

craft()->email->sendEmail($emailModel);