SimpleMailer Forum Board

thanks for the reply … so i dont have to go http://localhost/atlantiasearchfinal1/protected/modules/SimpleMailer/ … this is wrong right … if i directly try to go to simplemailer it says it dosent exist … yea can you send me the code which renders the simplemailer in coloumn2 … also i dont have a casesensitive so the default would be true right … or do i have to define a casesensitive ??? and if you can send a small example code that would be of great help … thanks a lot

Check the url you’re typing. Why are you including “protected/modules” in it? It is just “http://localhost/SimpleMailer”.

http://localhost/SimpleMailer says it dosent exist … how do i render in column2 … ??

Let’s just forget about the view layout (the column2 thing). Check your installation of SimpleMailer. Be sure you’re following to the letter the installation instructions because seems like it is not installed at all.

i installed it again man … i am still confused with crontab command … how to save it ??

but i should be able to access simple mailer … which i am not able to do so … can you please create a demo of simple mailer or something … i am sorry i am asking for a lot … but i have tried almost everything i knew and it still dosent work … i need to implement this … please help me with this … thanks a lot …

If you’re using Windows I’m afraid I can’t help you since I use Linux. You always have Google to find out how to do things.

I’m gonna give you some instructions, however.

For crontab, at the console type:

crontab -e

Copy and paste the crontab lines into the editor and then save.

The installation document is quite explicit. I can’t tell you more because already everything is there. Also I can’t give you a ‘example code’ because all you need to know is exactly in the documentation.

Look for someone there were you work for help on how to do the required things in Linux.

I’m sorry I can’t give you any more help.

Please post your config file to check it doesn’t contain probable problems.

hey chirvo you were right … i was following the instructions but somewhere i was making a mistake … so the simple mailer works nicely thanks a lot …

i still have 2 questions :

1- how to send different templates to different users .

2- and when i copy the link to the body it just send the link in the mail … i want to send the page … what am i doing wrong here ?

Good day all,

@vrooomm, here your answers:

1.- Create different mailing lists for your user groups or whatever logic you’re using to classify your users. Please read this.

2.- You must paste the page contents, not its origin url. Pay attention to the first two steps on the "Usage" part on the SimpleMailer documentation.

Hey, for a solution to the limitation not being able to send to a list with a template, its simple, just add the name, lastname, etc fields in the same “SELECT email,name,etc FROM profile WHERE location=‘atlantis’;” sql query, and just fetch those values

Interesting. I can map the table columns names to template variables, as in ‘name’ would map to NAME. That, as you say, will definitely overcome the limitation of not being able to personalize emails when sending to a list.

Thank you. That’s a simple, clever solution. I’ll implement this as soon as I can.

Stay tuned!

please help me.

Database has a record of sending letters (Table sm_queue).

cron to contain the string

0,30 **** /var/www//******/protected/yiic mailer

But the letters are sent.

Sorry for my english

If you followed the instructions to the letter you shouldn’t have any issues. If your app is not sending mail perhaps is because you or your system administrator didn’t configure properly your MTA.


Hi guys,

There’s a new version of SimpleMailer at GitHub. Consider it unstable. If you’re gonna test it I’ll be glad to hear you guys giving me feedback.

The new things are:

  • Now Mailing Lists support template vars (thanks to @grod for the idea).

  • Classes were renamed, stripping the ‘Simple’ prefix.

  • Now the installation should be in the ‘modules/mailer’ folder, solving the issue of the case sensitive URLs (@yugene discovered the issue months ago).

  • Changed the titles/link texts for the views to make them more consistent.

I’m going to test it for a while. In a week or so I’ll be launching a new version of SimpleMailer if everything goes well.


I’m just starting to implement this extension in a project. Thanks to Chirvo and Yuga for all the great work.

For some reason I wasn’t able to get the db migration to work using yiic. In case anyone else had the same problem as I did, or anyone is trying this without access to a terminal session on the server (thus no yiic), here is a SQL dump of the tables that have to be created:

CREATE TABLE `sm_list` (


  `name` varchar(64) NOT NULL,

  `description` varchar(255) DEFAULT NULL,

  `query` text,

  `email_field` varchar(255) NOT NULL,

  PRIMARY KEY (`id`),

  UNIQUE KEY `name` (`name`)

) TYPE=InnoDB;

CREATE TABLE `sm_queue` (


  `to` varchar(255) NOT NULL,

  `subject` varchar(255) NOT NULL,

  `body` text NOT NULL,

  `headers` text NOT NULL,

  `status` int(11) NOT NULL,

  `create_time` timestamp NULL DEFAULT NULL,

  `update_time` timestamp NULL DEFAULT NULL,

  PRIMARY KEY (`id`),

  KEY `to` (`to`),

  KEY `subject` (`subject`),

  KEY `status` (`status`)

) TYPE=InnoDB;

CREATE TABLE `sm_template` (


  `name` varchar(64) DEFAULT NULL,

  `description` varchar(255) NOT NULL,

  `from` varchar(255) DEFAULT NULL,

  `subject` varchar(255) DEFAULT NULL,

  `body` text,

  `alternative_body` text,

  PRIMARY KEY (`id`),

  UNIQUE KEY `name` (`name`)

) TYPE=InnoDB ;

(You don’t have to use the InnoDB engine if you don’t want to. I make it my default in order to take advantage of foreign key relationships.)

Thank you SteveD for the MySQL schema. I’m gonna add it to the documentation.

Hi Chirvo,

Congrats for the great module! I was planning to create the same module for a long time now (what a relieve).

I just wanted to let you know that I had to use it outside from another module (admin module) and in order to make it work I had to customize it a little bit:


 * --- SimpleMailer.components.SimpleMailer ----

 * add init method with empty body


public function init(){ }



 * --- SimpleMailer.SimpleMailerModule ----

 * add the following row to the init method


$this->setComponent('SimpleMailer', array('class' => 'SimpleMailer'));



 * Call it from an external module's controller


Yii::app()->getModule('SimpleMailer')->getComponent('SimpleMailer')->send('', 'template_name', $template_vars);