I've had no need to send mails on my 2 sites hosted at the UK Fasthosts provider.
But since I've added some email features to one of my sites I've tried to send mail via the Email Component of CakePHP and it doesn't leave the server, even if the send returns success.
我没有必要在我在英国Fasthosts提供商托管的2个网站上发送邮件。但是,因为我已经在我的一个网站上添加了一些电子邮件功能,我试图通过CakePHP的电子邮件组件发送邮件,并且它不会离开服务器,即使发送返回成功。
I've tried with plain mail() function and with the smtp option and got nowhere.
我尝试过使用普通邮件()函数和smtp选项而无处可去。
Any ideas?
4 个解决方案
#1
I had the same problem with Fasthosts. They have made it so you have to add -f
in front of your "sent from" email address so this is what my mail function call looks like:
我遇到了与Fasthosts相同的问题。他们已经这样做了,所以你必须在你的“发送自”电子邮件地址前加上-f,这就是我的邮件函数调用的样子:
mail($email_to, $email_subject, $email_message, $headers, '-f'.$email_from);
You can get more info from page on Fasthots help: http://www.fasthosts.co.uk/knowledge-base/?article_id=65
您可以从Fasthots帮助页面获取更多信息:http://www.fasthosts.co.uk/knowledge-base/?article_id = 65
#2
I am not familiar with that hosting service but I've had similar experiences with other providers. The one thing that's worked across them all is the SwiftMailer library. Check it out and see if it works for you.
我不熟悉托管服务,但我与其他提供商有过类似的经历。它们之间的一件事是SwiftMailer库。检查一下,看看它是否适合你。
#3
Check out SwitfMail (http://swiftmailer.org/). You can connect to most mail systems and send email, no local configuration or dependencies. I regular send alerts through my gmail account. It's very robust, but has a "simple" execution option if you are not trying to manage email lists.
查看SwitfMail(http://swiftmailer.org/)。您可以连接到大多数邮件系统并发送电子邮件,无需本地配置或依赖项。我经常通过我的Gmail帐户发送提醒。它非常强大,但如果您不想管理电子邮件列表,则可以使用“简单”执行选项。
#4
your code isnt the problem. your email server has alot of queued email. the same issue happend to me with godaddys email server. just give it a day and try again.
你的代码不是问题。您的电子邮件服务器有很多排队的电子邮件。与godaddys电子邮件服务器发生同样的问题。只需给它一天再试一次。
#1
I had the same problem with Fasthosts. They have made it so you have to add -f
in front of your "sent from" email address so this is what my mail function call looks like:
我遇到了与Fasthosts相同的问题。他们已经这样做了,所以你必须在你的“发送自”电子邮件地址前加上-f,这就是我的邮件函数调用的样子:
mail($email_to, $email_subject, $email_message, $headers, '-f'.$email_from);
You can get more info from page on Fasthots help: http://www.fasthosts.co.uk/knowledge-base/?article_id=65
您可以从Fasthots帮助页面获取更多信息:http://www.fasthosts.co.uk/knowledge-base/?article_id = 65
#2
I am not familiar with that hosting service but I've had similar experiences with other providers. The one thing that's worked across them all is the SwiftMailer library. Check it out and see if it works for you.
我不熟悉托管服务,但我与其他提供商有过类似的经历。它们之间的一件事是SwiftMailer库。检查一下,看看它是否适合你。
#3
Check out SwitfMail (http://swiftmailer.org/). You can connect to most mail systems and send email, no local configuration or dependencies. I regular send alerts through my gmail account. It's very robust, but has a "simple" execution option if you are not trying to manage email lists.
查看SwitfMail(http://swiftmailer.org/)。您可以连接到大多数邮件系统并发送电子邮件,无需本地配置或依赖项。我经常通过我的Gmail帐户发送提醒。它非常强大,但如果您不想管理电子邮件列表,则可以使用“简单”执行选项。
#4
your code isnt the problem. your email server has alot of queued email. the same issue happend to me with godaddys email server. just give it a day and try again.
你的代码不是问题。您的电子邮件服务器有很多排队的电子邮件。与godaddys电子邮件服务器发生同样的问题。只需给它一天再试一次。