I'm trying to send the email from Notes which are of different domain mails. While sending an email i'm recieving an error "Error transfering to mail.target-domain.com; SMTP Protocol Returned a Permanent Error 554 5.7.1 <mail.my-domain.com: Access denied"
The configuration and the code level scripts are good and i don't see any error in code. Sometimes the mail send successfully, sometimes it throws such kind of error, sometimes if we retry to send email it sends.
I don't know where it throws an error
How to resolve this and why does this error appears?
It is not related to your script, it's a security configured in the server.
You have to work with your admin to understand if the security is triggered because of the FROM/sender address, the recipient address, your IP, or more probably the combo of sendername/recipient , or the SMTP relaying from some IP to some other IP.
Also, if your script is in an agent, the sender address is often forged by the agent/server, and is not a valid one.
Related
I have a VPS server with CPanel on my domain (say mydomain.com). I have a SuiteCRM installed on a subdomain (say sub.mydomain.com) and I am sending mass emails from it in a batch of 90 every hour.
While sending the emails from the CRM (Authenticated SMTP mode) the emails are getting deferred with the error:
SMTP error from remote mail server after MAIL FROM:< myemail#mydomain.com> SIZE=562346: 451 <myemail#mydomain.com> server temporarily unavailable. AUP#MXRT
The SPF, DKIM and DMARC everything is fine.
I am suspecting it could be a max rate warning/failure (MaXRaTe hence MXRT) from the remote/recepient mail server. It is failing/deferring emails for Gmail, Yahoo and other email providers not for any company-specific emails like someone#somecompany.com
There seems a limit on emails for Gmail and other vendors. I had gone through these where Gmail specifically pointing out the limits and do's and don'ts:
https://support.google.com/mail/answer/22839?hl=en#zippy=%2Cyou-have-reached-a-limit-for-sending-mail
https://support.google.com/mail/answer/81126
In my case, I find myself well under the limit. So, why I am getting this error?
Second thought: It could be due to that I am sending 90 emails in one go. If I send emails one-by-one after a delay (say 3-5 seconds) then there won't be any problem. Enlighten me on this too.
I later realized that, even any one-to-one email I am sending via Thunderbird from my server (SMTP), even to a single recepients, is failing. I have checked check.spamhaus.org and intodns.com everything is alright there.
My Environment (Though this hardly matter in context of my problem but just in case):
BigRock's VPS Server with CPanel (Version)
Apache Version: 2.4.53
MySQL Version: 8.0.29
WHM Version: 102.0.18
CentOS Version: 7.9.2009 (Standard KVM)
Note: I haven't mentioned my actual domain name just for the privacy and security since I feel putting everything here will pose risks.
I am using PHPMailer to connect to a remote smtp server running Exim.
In my exim logs, I can see that the sending failed, but PHPMailer does not catch an exception and it seems like the SMTP server is returning an "Ok" status.
Here is the excerpt from my exim log:
2019-06-27 17:03:00 1hgbXj-0000O5-Vl == *******#gmail.com R=dnslookup T=remote_smtp defer (-44) H=alt4.gmail-smtp-in.l.google.com [108.177.119.27]: SMTP error from remote mail server after RCPT TO:<********#gmail.com>: 452-4.2.2 The email account that you tried to reach is over quota. Please direct\n452-4.2.2 the recipient to\n452 4.2.2 https://support.google.com/mail/?p=OverQuotaTemp **** - gsmtp
And here is the (end of the) PHPMailer debug output:
SERVER -> CLIENT: 250 OK id=1hgbf8-0008CL-15
CLIENT -> SERVER: RSET
SERVER -> CLIENT: 250 Reset OK
Done #0.0734977722168s
CLIENT -> SERVER: QUIT
Any way I can see this error in PHP so that I can log the error in my application?
This is nothing to do with PHPMailer. The PHPMailer debug output shows a successful delivery to your exim server. That's where its involvement ends - at no point does PHPMailer talk to gmail, and so never sees this response.
Exim (as intended) then goes on to try to deliver the message, but receives a failure notice from gmail. What you should then see in your logs is an attempt by exim to bounce the message to the return path, which is set by your mail server from the SMTP envelope sender used to submit the original message. You can control this address by setting the Sender property in PHPMailer, though it defaults to your from address, which is what you'd usually want.
If you want to hear about these bounces in your code instead of your mailbox, you need to get exim to pipe them to a script rather than a mailbox, and this is something that exim is quite happy to do.
Bounce handling is not a pleasant thing to write, but you may find that using VERP addressing helps.
I am using sendmail on ubuntu to send the mail from my server.
I am able to deliver the mails on my domain myid#mydoamin.com but unable to get it on myid#gmail.com .
When I checked the mail.log file is showing "stat=Service unavailable" for myid#gmail.com and "stat=Sent (t7D7KdJa029551 Message accepted for delivery" for myid#mydomain.com.
I have two another server and have done the same thing for sendmail and those servers is working very well.
I have proper hostname and host name entry in /etc/hosts file.
What would be the issue?
Im using PHPmailer to send email if user enter his e-mail. But sometimes (1/2 of emails) i get an error:
2013-10-15 11:12:39 SERVER -> CLIENT: 555 sorry, too many emails (#5.7.1)
2013-10-15 11:12:39 SMTP ERROR: Password command failed: 555 sorry, too many emails (#5.7.1)
2013-10-15 11:12:39 CLIENT -> SERVER: QUIT
2013-10-15 11:12:39 SERVER -> CLIENT:
2013-10-15 11:12:39 SMTP ERROR: QUIT command failed:
SMTP connect() failed.
In one of my project I also experienced this error. You reached the limit of emails you're allowed to send for this mailserver (preventing its usage as spam server). You could implement a queue to spread sending the mails over a given time or you could try to find another mail server. Mail servers of Internet Providers usually have good sending rates.
I am trying to create a small desktop app that sends out e-mails to people in the office (all internal). My application would run on a PC that is also on the network and the user will have outlook running for his own e-mails.
I'm looking at several examples where you need the SmtpClient and it needs to equal a host. Is there a way that I can just set it to use the local machine?
MailMessage mailObj = new MailMessage("admin#network.com",
reader["recipientAddress"].ToString(), "Subject", "Body");
SmtpClient SMTPServer = new SmtpClient("127.0.0.1");
SMTPServer.Send(mailObj);
I read that 127.0.0.1 is the local machine. Would this work, or is there a different way of going about this?
Also would my messages go out if it sent a message to an external email?
You have to install a SMTP server on your localhost to be able to send mail.
Outlook only receives e-mails through POP3 or IMAP, etc.
edit:
i.e. you need
some server that accepts mail through SMTP from your client and forwards it to its destination; and
some server that accepts mail (normally through SMTP) and stores it in a mailbox, so people can retrieve them later through POP3 or IMAP or whatever means.
Your company mail server should normally do both.
edit2:
You might be able to cheat and use SMTPClient to deliver the mail to the receiver's mailbox server directly though.
Try resolving for the MX record (see How to get mx records for a dns name with System.Net.DNS?) and create a SMTPClient directly to the best MX server returned.
If Microsoft implemented enough of the SMTP specification and your host is not treated as sending spam, the mail should go through.