Yii Framework Forum: Sending mail to different users with different contents - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Sending mail to different users with different contents

#1 User is offline   tammy 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 17-December 16

Posted 17 December 2016 - 06:12 AM

How can i send different mail to different users using swiftMail mailer . I am very new to this yii2. Please give me sometips to overcome this situation.


//Here is my function in helper.php

public static function actionSendMailv2()
{
$status = FALSE;
try
{
$status = Yii::$app->mailer->compose()
->setTo('sai@abc.com')
->setCc(array('tammy@abc.com'))

->setFrom('contact@abc.com',"abc")
->setSubject("hello from abc")
->setHtmlBody("hi test")
->send();
}
catch(Exception $e)
{
$status = FALSE;
}
return $status;
}


Thanks.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users