Yii Framework Forum: send mail throught cron job - Yii Framework Forum

Jump to content

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

send mail throught cron job Rate Topic: -----

#1 User is offline   oma378501 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 11-May 14
  • Location:Cercado, Cochabamba

Posted 07 May 2015 - 09:33 AM

Hi everyone

I have problem for send mail. now I have user YiiMailer extension for send mail. but body message is:

Content-type: text/html

Any suggestion.
0

#2 User is offline   duri 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 188
  • Joined: 18-December 14
  • Location:Bosnia and Herzegovina

Posted 07 May 2015 - 11:51 AM

Hi, please post some of your code in the post and we will help you :)
The point is to understand!

Developers: CODE EPICENTER

0

#3 User is offline   Yuv 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 15-April 15

Posted 08 May 2015 - 11:29 AM

$email = new YiiMailMessage();
$email->view = '//path/to/view/file';
$email->setTo($user->email);
$email->setFrom(Yii::app()->params['noReplyEmail']);
$email->setSubject('this is a test');
$email->setBody(array('model' => $model), 'text/html');
Yii::app()->mail->send($email);

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