jsduniya
jsduniya

Reputation: 2474

CakePHP Email component issue

My Code

$result = $email->template('expiry_mail_template', 'default')
                ->emailFormat('html')
                ->to($tomailbuyer)
                ->from(Configure::read('site.support_email'))
                ->subject($mailSubject)
                ->viewVars($content);

                if($email->send('default')){
                    echo "Mail Sent";
                } else {
                    echo "Mail Not Sent";
                }

When I run my program, it's executing $email->send('default') and printing the Mail Sent string, but I am not receiving mails.

Can any body tell me what may be reason? I was getting the mails, then suddenly after 2 hrs I was not getting them. Is it a server issue, or anything like we can only send max 250 mails per day?

Upvotes: 1

Views: 78

Answers (1)

MrSynAckSter
MrSynAckSter

Reputation: 1770

It's your server. Cake's E-mail is pretty easy to configure, but different hosting services have different attitudes toward e-mail apps and can delay your e-mails for hours. For instance, in my app it is common for the first e-mail of the delay to be delayed for 30 minutes to an hour, and subsequent e-mails to send instantly.

Also, be aware that sending out too many e-mails from your app can look like spam to both your host, and to ISPs who might trash your e-mails on site.

Upvotes: 1

Related Questions