email not sent in cronjob sugarCRM - sugarcrm

I have set email settings using gmail from my localhost successfully and my sugar instance is sending test mail well. I also done with cron job setup and tested it.
The problem occurs when i try to send email in a cron job it cannot be send. My basic code i am using is
require_once('include/SugarPHPMailer.php');
$emailObj = new Email();
$defaults = $emailObj->getSystemDefaultEmail();
$mail = new SugarPHPMailer();
$mail->setMailerForSystem();
$mail->From = $defaults['email'];
$mail->FromName = $defaults['name'];
$mail->Subject=from_html($bean->name);
$mail->Body="hello this is testing ....!";
$mail->prepForOutbound();
$mail->AddAddress('abc#yahoo.com');
#$mail->Send();
The following errors displayed in fatal log .
09/24/12 10:58:07 [4560][1][FATAL] SMTP -> ERROR: EHLO not accepted from server. Code: , Reply:
09/24/12 10:58:07 [4560][1][FATAL] SMTP -> ERROR: HELO not accepted from server. Code: , Reply:
09/24/12 10:58:07 [4560][1][FATAL] SMTP -> ERROR:AUTH not accepted from server. Code: Reply:
09/24/12 10:58:07 [4560][1][FATAL] SugarPHPMailer encountered an error: SMTP Error: Could not authenticate.
09/24/12 10:58:07 [4560][1][FATAL] SugarPHPMailer encountered an error: SMTP Error: Could not connect to SMTP host.
09/24/12 10:58:07 [4560][1][FATAL] SugarPHPMailer encountered an error: An outgoing mail server is not configured to send emails. Please configure an outgoing mail server or select an outgoing mail server for the mail account that you are using in Settings >> Mail Account.
Some time it give follwing one,
09/24/12 11:01:07 [832][1][FATAL] SugarPHPMailer encountered an error: Language string failed to load: tls
can anybody help please?

Related

Client does not have permissions to send as this sender in Jenkins

I installed Jenkins (Jenkins ver. 2.46.2) and i have configured SMTP Server in Manage Jenkins -> Configure System -> Email Notification.
Test mail is works fine. But in Job email notification not working.
Error message as : Error sending to the following VALID addresses
I checked the Jenkins log file.
550 5.7.60 SMTP; Client does not have permissions to send as this sender [KL1PR03MB1749.apcprd03.prod.outlook.com]
DEBUG SMTP: got response code 550, with response: 550 5.7.60 SMTP; Client does not have permissions to send as this sender [KL1PR03MB1749.apcprd03.prod.outlook.com]
RSET
250 2.0.0 Resetting
com.sun.mail.smtp.SMTPSendFailedException: 550 5.7.60 SMTP; Client does not have permissions to send as this sender [KL1PR03MB1749.apcprd03.prod.outlook.com]
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2057)
at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1862)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1100)
at javax.mail.Transport.send0(Transport.java:195)
at javax.mail.Transport.send(Transport.java:124)
at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:357)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:322)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:230)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
at hudson.model.Build$BuildExecution.cleanUp(Build.java:196)
at hudson.model.Run.execute(Run.java:1775)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:405)
QUIT
How to fix this issue?
You need to set "System Admin email address" under Manage Jenkins -> Configure System. This is under the Jenkins Location header on that page!
Have a look at below thread.
How can I set the Sender's address in Jenkins?

Exim4 on server. Sending to it from another smtp. Sender verify failed

I have Exim on server with test#domain.com email.
And now i'm sending email to test#domain.com from test2#domain.com but using provider SMTP and i'm getting following error:
Failed: test2#domain.com → test#domain.com 'Microsoft Office Outlook Test Message' Server response:
550 550 Verification failed for <bounce+2db7fb.5fc31-info=test#domain.com> Unrouteable address Sender verify failed
How can i put my SMTP (sender) to white list?
Have you correctly setup your domain MX record your server ? I think there is an issues with the mx record of your domain.

454 Error: authentication failed when using Net::SMTP::SSL to send email

I use Net::SMTP::SSL to sent email in Perl, and got "454 Error: authentication failed"
Here is my code:
use Net::SMTP::SSL;
$smtp = Net::SMTP::SSL->new($smtp2, Port => $smtp_port2, Timeout => 10, Debug => 1);
$smtp->auth($login2, $password2);
$smtp->mail($login2);
$smtp->to($to);
$smtp->data();
$smtp->datasend("To: $to\n");
$smtp->datasend("From: Aspiring error email \n");
$smtp->datasend("Date: $today\n");
$smtp->datasend("Subject: $subject\n");
$smtp->datasend("\n");
$smtp->datasend($message);
$smtp->dataend();
$smtp->quit;
And i got these message:
Net::SMTP::SSL=GLOB(0xf9ab80)<<< 454 Error: authentication failed, system busy
It seem i failed to auth, and i am sure the username and pw is correct.
Thanks so much!!!
454 Error: authentication failed, system busy
These are temporary problems.
The mail server is probably not doing local verification of the password, but is using an external system like a Radius or LDAP server, and the connection to this authentication system failed. Just try again later and hope that the problem got resolved.
If the credentials were wrong the server would have send a 535 status code.
See also the status codes in RFC4954.

SMTP Error <<: 503 AUTH command used when not advertised

I am facing this error in Webmail Lite.
I have Exim installed. Here is a snippet of the auth block:
PLAIN:
driver = plaintext
server_set_id = $auth2
server_prompts = :
.ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
server_advertise_condition = ${if eq{$tls_cipher}{}{}{*}}
.endif
server_condition = “${if crypteq{$auth3}{${extract{1}{:}{${lookup{$auth2}lsearch{/etc/$domain/passwd}{$value}{*:*}}}}}{1}{0}}”
I have the passwd stored in the following format:
username:{MD5}asddfasdlasdkandlanskfdaf
How do I get AUTH enabled and working ?
Thanks in advance.
One reason for this error message is sending HELO instead of EHLO, or sending EHLO in the wrong order.
But this message can occur even if EHLO is used, when the server is running Exim.
On my server, I found the solution. In WHM > Home > Service Configuration > Exim
Configuration Manager, the option "Require clients to connect with SSL
or issue the STARTTLS command before they are allowed to authenticate
with the server" was set to the default (On). I'm not sure if I did this
or not, and it is ordinarily a great idea for security, but forces the
mailserver to enable (advertise) only the STARTTLS command, not AUTH. So
when my script sends AUTH, the error message the server sends is correct.
Further information is at http://blog.networkpresence.co/?p=8923 .
Someday when I have time I will find out how to change my script to use
TLS, so I can turn that Exim option On for security.
In my case,this error not coming regularly.some time it works but some time it gives this error.(SMTP Error: Could not authenticate.)
I debug this then I found this
SMTP -> get_lines(): $data was ""
SMTP -> get_lines(): $str is "503 AUTH command used when not advertised "
SMTP -> get_lines(): $data is "503 AUTH command used when not advertised "
SMTP -> FROM SERVER:503 AUTH command used when not advertised
SMTP -> ERROR: RSET failed: 503 AUTH command used when not advertised
SMTP Error: Could not authenticate.

How do you fix 550 must be authenticated sending Mail using Grails?

I'm using Grails Mail plugin and trying to send email and keep getting:
Error 500: Executing action [sendInvite] of controller
[RegisterController] caused exception: Failed messages:
javax.mail.SendFailedException: Invalid Addresses; nested exception
is: com.sun.mail.smtp.SMTPAddressFailedException: 550 must be
authenticated
I'm properly following the instructions at: http://www.grails.org/Mail+plugin
The mail server is returning an error when you try to send out the mail. 550 is a generic SMTP failure code; in this case it looks like you are missing a username and password. Some SMTP servers to not require authentication but most do, especially if they're publicly available on the internet. It's also possible that your SMTP server requires an SSL connection and you're connecting with an unsecured socket.
The example config for gmail shows how to set all the mail server authentication options in Config.groovy:
grails {
mail {
host = "smtp.gmail.com"
port = 465
username = "youracount#gmail.com"
password = "yourpassword"
props = ["mail.smtp.auth":"true",
"mail.smtp.socketFactory.port":"465",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback":"false"]
}
}
Add "mail.debug": "true" to props to turn on JavaMail debugging to get a better picture of what is happening before the failure.
In my case the 550 error was caused by me having accidentally selected and IMAP account as the default account but sending emails from my Outlook Connector Account (which has no authentication settings to make).
I changed the Outlook Connector Account to default. Resent the emails and no errors.
So check that the correct email account is set up as the default also