SOS Job Scheduler Email Alert Issue (Windows) - scheduling

Not sure how many of you used SOS Job Scheduler before but i'm having issues sending out error alert emails.
I captured the log below of the problem i've been having and also provided a link for reference.
http://www.sos-berlin.com/doc/en/scheduler.doc/email.xml
`2013-07-28 22:44:27.671+0800 [WARN] SCHEDULER-302 Error sending e-mail: Z-JAVA-105 Java exception javax.mail.internet.AddressException("Empty address"), method=set [from= ....
`
My factory.ini settings are below:
`html_dir = ${SCHEDULER_HOME}/operations_gui
mail_on_error = yes
mail_on_warning = yes
mail_on_success = yes
mail_on_process = no
log_mail_from = abc#gmail.com
log_mail_to = edf#hotmail.com
log_mail_cc =
log_mail_bcc =
smtp = smtp.gmail.com
mail_queue_dir = ${SCHEDULER_DATA}/mail
mail.smtp.user = abc#gmail.com
mail.smtp.password = xxxxxx
mail.smtp.port = 587
mail.smtp.starttls.required = true`
Has anyone come across this issue before ? I'm out of ideas so if anybody can point me in the right direction it would be much obliged.
Thanks in advance !

Looks like you hit bug #JS-987 described here: JobScheduler cannot send email.

Related

Get subject new mails from a office365 mail account

I am trying to download the subject of all new mails. The mails are stored in an office365 mail account. So far i have the following:
<cfimap
action ="OPEN"
connection = "Test"
password = "xxxx"
port = "993"
secure = "yes"
server = "outlook.office365.com"
stoponerror = "true"
timeout = "10"
username = "xxxx">
<cfimap
action="getHeaderOnly"
folder="Inbox"
connection="Test"
name="getHeaders"
>
<Cfdump var=#getHeaders#>
<cfimap action="close" connection = "Test">
This is ridiculously slow (several minutes). In my situation I only need to download the subject line of all new mails. I do not need anything else. Any thoughts on how to speed up things.
Update
Came up with an alternative solution. See Convert java code to coldfusion code for an alternative to the cfimap tag.

Unable to relay recipient in non-accepted domain

All emails with the domain #mycompany.com are sent successfully. But, if MantisBT wants to send an email to anyone else, for example #othercontractor.com, or #gmail.com, etc , the email is not sent.
In addition, a collateral damage of this problematic email is that it will get stuck in "MySqlDatabase/mantis_email_table" and all the emails after this problematic email in that table won't be sent. So, to fix it, I have to manually delete that entry in the table. It is not very convenient when I want to add contractor who has his own email domain in our bug tracker.
This the email configuration in: /path_to_mantis_bt/config/config_inc.php
// Email Configuration
$g_email_send_using_cronjob = ON;
$g_allow_signup = ON; //allows the users to sign up for a new account
$g_enable_email_notification = ON; //enables the email messages
$g_phpMailer_method = PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'edge.mycompany.com';
$g_smtp_connection_mode = '';
$g_smtp_port = 25;
$g_administrator_email = 'myname#mycompany.com';
$g_from_email = 'myname#mycompany.com';
$g_return_path_email = 'myname#mycompany.com';
$g_from_name = 'Mantis Bug Tracker';
I should mention that we are hosting MantisBT on our own server Microsoft Server 2012 R2 and WAMP(latest version).
The error: 2018-01-08 10:24 PST MAIL email_api.php:1379 email_send() ERROR: Message could not be sent - SMTP Error: The following recipients failed: xxx#gmail.com: 5.7.54 SMTP; Unable to relay recipient in non-accepted domain
It's working now, but I used sendmail instead of using the WAMP/SMTP.
To install SENDMAIL on WAMP, I followed these instructions
This the email configuration in: /path_to_mantis_bt/config/config_inc.php
$g_allow_signup = ON; //allows the users to sign up for a new account
$g_enable_email_notification = ON; //enables the email messages
$g_phpMailer_method = PHPMAILER_METHOD_SENDMAIL; //If not using sendmail, use: PHPMAILER_METHOD_SMTP;
$g_smtp_host = 'edge.mycompany.com';
$g_smtp_connection_mode = 'tls';
$g_smtp_port = 587;
$g_smtp_username = 'xxx'; // my username for email myname#mycompany.com
$g_smtp_password = 'xxx'; // my password for email myname#mycompany.com
$g_administrator_email = 'myname#mycompany.com';
$g_webmaster_email = 'myname#mycompany.com';
$g_from_email = 'myname#mycompany.com';
$g_return_path_email = 'myname#mycompany.com';
$g_from_name = 'Mantis Bug Tracker';
// Log configuration
$g_log_level = LOG_EMAIL | LOG_EMAIL_RECIPIENT | LOG_FILTERING | LOG_AJAX;
$g_log_destination = 'file:/wamp64/logs/mantis.log';
?>
IF you follow the link above, you will know how to update php.ini and sendmail.ini . Update these 2 files with the information in config_inc.php.
I had the same issue. In my case, we were sending out emails from an application and there was a user bcced (hardcoded in the code) which was not in the domain and hence it failed
I had same issue once I changed to #newdomain.com.
In my case I found suggestion on the web to clear cache of my browser. I did and all start working.
Basically, you need to reload all config files from scratch with new globals...
At least it worked for me.
Cheers.

HTTPError: HTTP Error 401: Unauthorized for sendgrid integration with python

def sendEmail(to,apNumber,paperType,zipedFile):
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get("API-KEY"))
to_email = mail.Email( "to#email.com")
from_email = mail.Email( "from#email.com" )
subject = 'This is a test email'
content = mail.Content('text/plain', 'Example message.')
message = mail.Mail(from_email, subject, to_email, content)
response = sg.client.mail.send.post(request_body = message.get())
return response
Setup Environment Variables.
To Set up environment Variable follow the below 3 steps
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env
import os
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail
message = Mail(
from_email='...#gmail.com',
to_emails='....#gmail.com',
subject='Sending with Twilio SendGrid is Fun',
html_content='<strong>and easy to do anywhere, even with Python</strong>')
try:
**sg = sendgrid.SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY'))**
response = sg.send(message)
print(response.status_code)
print(response.body)
print(response.headers)
except Exception as e:
print(e)
I got the same error "UnauthorizedError: HTTP Error 401: Unauthorized"
I refactored the code from
sg = sendgrid.SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY'))
to
sg=SendGridAPIClient('......IeltIytmFYeQ0aSOt2UBYvv2E6Xh...')
Then it started working.
I change my API key settings to Full access in SendGrid portal.
I was getting "HTTP/1.1 401 Unauthorized" error in PHP. See the screenshot.
I solved it by removing getenv() from the API key.
Replace:
$apiKey = getenv("SendGrid_API_Key");
$sendgrid = new \SendGrid($apiKey);
with:
$apiKey = ("SendGrid_API_Key");
$sendgrid = new \SendGrid($apiKey);
I created a new key and that solved my issue. Exact issue for this is still unknown.
As it was functional before.
The error for me was because I used the wrong key , actually, one needs to use the key that is created the first time when one create the Api key , which one cannot edit again. So one have to click "Create Api key" button and use this key

Email clients for Dynamics AX

I am wondering how the process of sending email is working between Dynamics Ax client and Email client that is set for the server as default email client.
First of all can Dynamics Ax use alternative email clients (not outlook) for sending emails and second of all is Dynamics Ax sending whole configuration to the client, or client has to be configured by itself.
Right now I am experiencing unknown error while trying to send email using Windows Live Mail.
Dynamics AX uses MAPI for client mail.
You can use the SysINetMail::sendEMail method to send a simple mail using this.
If you mail in batch another option is to use SMTP mail using SysEmailTable::sendMail.
This requires the use of mail templates.
I know this is an old question but if someone else needs it...
I am using this on a Dynamics AX 2009 and it works like a charm :)
server static boolean sendEmail(EmplId _fromEmplId, EmplId _toEmplId, str _subject, str message, EmailPriority _priority = EmailPriority::Normal)
{
boolean ok = true;
SysEmailBatch emailBatch;
EmplTable fromEmplTable;
EmplTable toEmplTable;
Email fromEmail;
Email toEmail;
;
changecompany( -- TO YOUR MASTER COMPANY --)
{
fromEmplTable = EmplTable::find(_fromEmplId);
toEmplTable = EmplTable::find(_toEmplId);
fromEmail = fromEmplTable.email();
toEmail = toEmplTable.email();
if (! fromEmail)
{
ok = checkFailed(strfmt("no email set up for %1", _fromEmplId));
}
if (! toEmail)
{
ok = checkFailed(strfmt("no email set up for %1", _toEmplId));
}
if (ok)
{
emailBatch = SysEmailBatch::construct();
emailBatch.parmSendername(fromEmplTable.name());
emailBatch.parmSenderAddr(fromEmplTable.email());
emailBatch.parmEmailAddr(toEmplTable.email());
emailBatch.parmPriority(_priority);
emailBatch.parmSubject(_subject);
emailBatch.parmMessageBody(_message);
emailBatch.run();
}
}
return ok;
}
Using SysOutgoingEmailTable and SysOutgoingEmailData you can send email to recipient of any domain and attach files too.
you have following fields:
outgoingEmailTable.EmailItemId
outgoingEmailTable.IsSystemEmail
outgoingEmailTable.Sender
outgoingEmailTable.SenderName
outgoingEmailTable.Recipient
outgoingEmailTable.Subject
outgoingEmailTable.Priority
outgoingEmailTable.WithRetries
outgoingEmailTable.RetryNum
outgoingEmailTable.UserId
outgoingEmailTable.Status
outgoingEmailTable.Message
outgoingEmailTable.TemplateId
outgoingEmailTable.LatestStatusChangeDateTime
outgoingEmailData.EmailItemId
outgoingEmailData.FileName
outgoingEmailData.EmailDataType
outgoingEmailData.FileExtension
insert respective email detail in these tables and you are good to go. Further if it gives permission error do add permission set with
CodeAccessPermission::assertMultiple .

How do I set the from_email var

I'm trying to use Amazon's SES and the Django-ses app to send emails. It works locally but fails on the server, returning the SESAddressNotVerifiedError.
Inspecting the trace revealed that it's failing because the from_email var is set to webmaster#localhost. I've looked all over to find where I set this variable to my verified email address in AWS-SES.
Does anyone know how I am supposed to change the from_email var from webmaster#localhost to myemail#myemail.com?
Thanks,
Anthony
So it turns out that what I needed to change was this setting:
DEFAULT_FROM_EMAIL = 'My Domain < myEmail#myEmail.com >'
For everyone who is using Django-Registrations this is the default, but the reference to it is in registration/models.py, line 264 (the last line) if you want to change it, which I might unless it breaks, in which case, I'll report back.
Django default_from_email name
Thanks to Ashok for this solution