SMTP mailing on localhost - php

I am using WAMP on my local computer and I want to use my web hosting smtp.domainname.com to test sending email from my localhost. I have already set smtp, and its port number in php.ini.
it shows the following error.
==================================
( ! ) Warning: mail( [function.mail]: SMTP server response: 550 bosauthsmtp14: Host ipaddress : No unauthenticated relaying permitted in C:\wamp\www\client\email_test.php on line 7
=================================
I am using mail("you#you.com","subject","body").
I am completely new to SMTP. Can anyone help me..

Most webhosts don't allow the requests to originate outside their server farm. Have you checked to make sure they allow this? The error message 550 is "Unable to relay." This would seem to indicate they aren't accepting your request to send an email.

Related

Swiftmailer raise an exception with code 554, client host rejected

I'm using Swiftmailer to send mail through a contact form with Symfony. My ISP allows me to send mail from a remote server with my mail account information (username, password and smtp).
My problem is that when I'm sending a mail from my development site (from my desktop server) I can do it and the mail is sent, but in the production environment Swiftmailer raise an exception saying that the client host is rejected (code 554 5.7.1) and failed to send the mail. I have tried to debug this with the app/console swiftmailer:email:send and I get the same error :
Exception occurred while flushing email queue:
Expected response code 220 but got code "554",
with message "554 5.7.1 <unknown[here-example-ipv6]:49545>:
Client host rejected: Access denied " [] []
The ipv6 (here-example-ipv6) is corresponding to a dns of my host that I have not configured, but I don't understand why Swiftmailer believes that this ip is corresponding to the client host, my configuration seems (app/config/config.yml and parameters.yml) to be good because that's work fine from my desktop. Any help would be appreciated, thank.
Ok, I get it. I was confused with the error message because I thought it was comming from Switmailler, but it was comming from my ISP mail server.
The problem was that when you want to send a mail from a remote location my ISP require to activate SSL encryption.
So I have added two more parameters for the Swfitmailler configuration :
port: 465
encryption: ssl
and now that's fine. But because I was testing from a production environment, the cache has to be cleared in order the changes to take effect.

'No Relay Access Allowed' in Swift Mailer

I recently transferred my server to VPS & now email function doesn't work for external emails.
Following are the settings I'm using:
$transport = Swift_SmtpTransport::newInstance('ns1.example.com', 465, 'ssl')
->setUsername('testing#example.com')
->setPassword('password');
$mailer = Swift_Mailer::newInstance($transport);
And the error that I'm getting is this:
SMTP error from remote mail server after initial connection:
host dedrelay.where.example.net [XX.XXX.XXX.XX]: 554
m1plded02-01.prod.mesa1.example.net : DED :
gWqF1p02c0cB4sG01 : DED : ESMTP
No Relay Access Allowed From XXX.XXX.XXX
I've tried telnet & response is ok. I've tried following:
telnet ns1.example.com 465
Response was:
connected to xx.xxx.xxx.xx
I'm also not able to configure my desktop email client. Can anyone tell a solution? Any help will be appreciated.
EDIT
I'm not even able to send an email through server's webmail. Same error.
You tried telnet ns1.example.com 465 and it connected. This shows the SMTP server is up and running and your computer can reach it. But this is not all you need.
The error message No Relay Access Allowed From 123.123.123.123 means the SMTP server is configured to not accept emails from this IP address for relay, i.e. emails that needs to be passed to another server for delivery.
This is an anti-abuse measure and it means the SMTP server is configured correctly.
There is nothing wrong with your SwiftMailer configuration. Any email client (including the desktop client, as you said) you use, the answer is the same.
You need to contact the system administrator of the SMTP server and ask them to allow your IP address to use their SMTP server as relay. If they are your ISP it's also possible that the server allows relay only after authentication: you have an username/password pair (that you use to read the emails, f.e.) and you need to use it in order to send emails through their SMTP server. But this is only a supposition (this is how it usually works); you have to ask them to know for sure.

Mail issue on XAMPP Localhost

I am using XAMPP 1.7.4 on Windows 8 When Mail Script is executed I got error Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail, sorry however this code works very well on live server
So what can be the issue ?
Thanks in advance for helping me.
Well, the error says it all. The SMTP server you're connecting to replies, that it doesn't relay non-local mail. So whatever SMTP server you've configured, it doesn't like it when the sending party is non-local, p.e. localhost or 127.0.0.1.
It doesn't seem to be an error in your code, it is more likely a configuration error in your script or in the SMTP server you want to relay to.

php+iis7 not able to send email?

I m not able to send email through php code using iis7 server.Here is the warning that i m getting from server.
Warning: mail(): SMTP server response: 550-(ip-0AD2EFB5) [ip]:50942 is currently not permitted to relay 550 through this server. in C:\inetpub\wwwroot\email\sendemail.php on line 17
and the 17th line is mail($to, $subject, $message, $headers)
can anybody help me solve this issue?
This issue has nothing to do with PHP nor IIS7, but with the SMTP policy.
The SMTP server in your network (or ISP/hosting) doesn't allow injection of mail from outside their network. You have to either connect to your SMTP from inside the ISP's network, or you some sort of authentication that is allowed to access the SMTP server.
This policy was made so that the SMTP won't be used by malicious user to inject spam mail (which is called 'open relay').
EDIT:
Just noticed your amazon-ec2 tag, it seems like you are running in Amazon AWS cloud?
Probably what you need is Amazon Simple Email Service

php mail invalid HELO name

i am trying to use localhost to send mail. however, i am getting this error when sending:
Warning: mail() [function.mail]: SMTP server response: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1). i have smtp settings correct in php.ini and am just confused as to what this means. thanks
There seem to be two primary reasons for this.
The first has to do with the email client configuration (google INVALID HELO OUTLOOK).
The other reason is an improperly configured SMTP server where the server sends out emails with only the server name and not a fully qualified name (e.g., emailserver vs emailserver.mydomain.com).
You should contact your hosting company and give them as much detail as you can. They should be able to help.
If you are using cPanel, you can disable HELO checking. See the user guide. The trade off is you will receive more spam...
I had a similar problem with postfix in Ubuntu. It turned out that I'd not set 'myhostname' in the postfix configuration file.
The problem disappeared when I configured 'myhostname' in the following file:
/etc/postfix/main.cf

Categories