Cannot send mail to extensions other than .com - php

I looked around for this one but I just can't find this anywhere.
I have a turnkey Linux server setup on an EC2-Instance on Amazon. It has Sendmail installed and Postfix (Standard installation, I did not install either of these). When I send mail using PHP function mail(), and I use a .com email address such as me#gmail.com, it delivers the mail just fine. But when I try something more exotic like user#company.co.uk, #company.net, #company.nl etc. I won't deliver the mail.
According to webmin, postfix is being used.
Does anyone have any experience with this?
Any help would be very nice. Thank you.

It could have recognized it as SPAM. Check the SPAM directory.

Related

gmail settings for sending mail on mac

I'm using mac OS snow leopard, and i have probs with mail, i'm not sure is it something about gmail, or php mail() func.
It's not working. I wrote it this way (just for testing ).
mail('something#example.com', 'My Subject', 'My Message');
I done * i need with postfix configuration, but it's not working (can't get the mail).
Any help, just need explanation on how things work. I'm googling last 3-4 hours, but nothing (didn't find the right answer). And yes, i'm using local server.
Thanks!
If your application is hosted in local host the mails will not be able to send. Upload to a live server and check it. (You need a mail server to send the mails)
Just a tip - if something isn't working, try and find the problem withing your code before blaming gmail or php functions. These have been tested and re-tested in live environments by literally millions of people.
Do you have a mail server installed and configured? Do you have Apache sendmail enabled?

Using PHP, Sendmail, and Undisclosed Recipients

I'm switching a web app over to AmazonSES. We're using PHP 5.3, PHPMailer, and we tried using the AmazonSES pear package but for some reason it was unbelievably slow on the live server. We switched to the Amazon perl script thats use sendmail instead and it's much faster.
However, the Undisclosed Recipients feature (built in to AmazonSES pear code) was no longer available. No matter what I do, the only thing I can get working it by addressing an email as "To: Undisclosed Recipients <workingadd#domain.com>"
The problem is that the working address HAS to be there: php's mail() func require it, phpmailer requires it. The problem is, using noreply# fails, but workingaddress# works. While the recipient list is protected, we end up getting all the emails at that address.
However, the Amazon code managed to send mails without a primary address. I can't find anything in their code that suggests the answer, nor on the net.
Please help!
Oh, You want to send mail, Please careful that MTAs don't you as SPAM, if you want to know all of its rules please read all of rules of SpamHaus
Set up an interim relay server with postfix or sendmail. Have your application send emails to that server. Have that server connect to amazon and send the mail to it. Let it handle the authentication, etc. It works extremely well.
--David

How can I send mail with PHP's mail() function and MAMP Pro?

I'm developing a website that will utilize PHP's mail() function. I'm running MAMP Pro (primarily because it has the Postfix feature that is supposed to be useful for sending emails). I feel like I've tried everything, but my program still won't send emails. It doesn't even really matter to me that I use mail(). I just want to be able to send emails from my local MAMP Pro webserver so I can test out my website. Any suggestions would be greatly appreciated!
You need to set it up for your ISP.
http://documentation.mamp.info/en/mamp-pro/server/postfix
also
http://blog-en.mamp.info/2009/09/how-to-sending-emails-with-mamp-pro.html
Other than that, I agree with the comments. What is your ISP? What is php telling you? Also, read your logfile for postfix and tell us what it says:
http://blog-en.mamp.info/2010/03/how-to-show-postfix-log-file-of-mamp.html

php mail() function not working

I'm getting a 'could not instantiate mail function' error from PHPMailer. From reading around, I understand this to mean that the PHP mail() function isn't working for some reason.
The results of phpinfo() for the mail settings are:
To me, this means that mail() should work and that port 25 is open. Is that right?
Is there anything else I can check to make this work please? I had a look at the docs for the mail() function, but I couldn't see what exceptions it threw and how I'd print them out to screen. I did a:
mail('name#email.com', "test", "test") or die("Doesn't work");
type test, but that's my error message and I could do with something a bit more helpful.
Grateful for any help on this.
Many thanks
it doesn't mean port 25 is open, it just means that PHP should use port 25 for contacting the SMTP server. You don't state what OS you're on, but note that sendmail would be a unix-only thing, and will fail if you're on Windows.
That list merely show you your current settings. That doesn't mean that they are right. :)
Your localhost is probably not configured to be a mail server. Set the smtp server to a real server than can be reached from your PHP server.
I am probably way off, but check to see if sendmail is installed, maybe it is malfunctioning. This depends on your OS.
The settings from phpinfo() show the PHP is set up to use SMTP but it does not mean that you have an SMTP server set up on the machine. Your error message suggests that one is not setup.
Good luck
My answer would be - don't send emails by calling Sendmail. The sendmail method (or ANY local method) is a mess of pitfalls... and even if you get past those issues, the bottom line is many spam filters (at the places you send mail TO) simply do not like this type of mail.
To provide just a little detail why the sendmail approach is bad, your sendmail daemon is unlikely to be configured to have an SMTP HELO which matches the reverse DNS of your IP address. Your webserver is unlikely to have valid reverse DNS matching a standard hostname. NO reverse DNS at all is bad, as is rdns like 123-123-123-123-static.someisp.com. SpamAssassing will flag such "unconfigured or default reverse DNS" hosts for example.
Fortunately you don't need to understand or fix everything I just said. The much simpler to accomplish (and easier to test/debug) is to GATEWAY your emails through a working SMTP mailserver. To do this:
1a) Install PHPMailer http://phpmailer.worxware.com/ ... OR
1b) Install the PEAR Mail() library http://pear.php.net/package/Mail
Either 1a or 1b will replace the limited "mail()" function in PHP. These replacements support both SMTP, and Authenticated SMTP.
2) I suggest using Authenticated SMTP over plain SMTP. Either works, but with authenticated SMTP you can literally send mail through another mail server just as IF your script were a local email client like Outlook. This has major benefits. For example, if you are a company sending mail, your mail is more likely to be trusted by remote/target mailservers, since your mailserver has a good reputation and (hopefully) proper reverse DNS setup. But if you originate the email off a webserver, you have none of that (and if you use shared webhosting, you will inherit the email reputation of whatever other sites run on your webserver IP.).

options for sending email via PHP

I am pretty new with the options of sending email via PHP code. The options available are sendmail, postfix, and PHPMail. If I use sendmail and postfix this means that I have to use PHP's mail function. I don't know about PHPMail. I will be sending email across domains (hotmail, yahoo, gmail, etc). It's an automatic email sent to a user's email after they completed something (say a registration). What do you guys think about this?
I've tried setting up sendmail in my Ubuntu server, but had some difficulties in setting it up. So that's why I am probably looking for more options.
You need a MTA (mail transport agent) on your machine (sendmail, postifx, ...) or you can connect to a mail provider like gmail using SMTP.
PHPMailer might be a good class for sending emails if you're not using any framework.
PHPMailer is on Google Code and GitHub.
You should have a pretty easy time setting up sendmail on ubuntu
http://ubuntuforums.org/showthread.php?t=196112
This gives the basics it takes to get sendmail installed.
If you are running this server from your house or some non-datacenter there is a chance that your ISP is blocking the port numbers you need such as port 25.
Read through that thread and it should give you some good suggestions for issues you may have.

Categories