I noticed that the Attachment in the Notify command is not mandatory to use but if I exclude the attachment the script fails. here is the script that i am currently using:
NOTIFY USER "%v_sender_email_acct%" MAILBOX "%v_smtp_sever%" ADDRESS "%v_recv_email_addr%" SUBJECT "SAE Exception Report from Global T&E Audit Team" MESSAGE "%v_msg%" ATTACHMENT "SAE_Exception_Report.xlsx"
I tried running the script without an attachment it fails, please see the script:
NOTIFY USER "%v_sender_email_acct%" MAILBOX "%v_smtp_sever%" ADDRESS "%v_recv_email_addr%" SUBJECT "SAE Exception Report from Global T&E Audit Team" MESSAGE "%v_msg%"
can you please tell me what do i have to do in order to remove the attachment?
Thank you for your help!
Regards,
Waseh
Related
The following is the error i get when i execute a simple package containing send mail task. i have configured the SMTP connection manager with server-smtp.office365.com and checked the windows authentication and ssl options too.
Thanks
Error: 0xC002F304 at Send Mail Task, Send Mail Task: An error occurred
with the following error message: "The SMTP server requires a secure
connection or the client was not authenticated. The server response
was: 5.7.57 SMTP; Client was not authenticated to send anonymous mail
during MAIL FROM [BMXPR01CA0031.INDPRD01.PROD.OUTLOOK.COM]".
This is a known issue. Check out this msdn link. It states the following in answer:
The SMTP Task in SSIS only supports Windows Authentication and the
port number cannot be changed. For a SMTP server that uses non-Windows
Authentication, we can use SmtpClient Class in Script Task to send the
email
That's why sending email via office365 fails.
In order to work with office365, either you can look for third party plugins integration with SSIS or you can use script task like below:
using System.Net.Mail;
using System.Net;
.
.
.
public void Main()
{
MailMessage mail = new MailMessage("<from email address>", "<to email address>");
mail.Body = "ssis sample email body";
mail.Subject = "ssis sample email subject";
//mail.Attachments.Add(new Attachment(AttachmentDiscardContratti));
//mail.Attachments.Add(new Attachment(AttachmentDiscardOrdini));
SmtpClient client = new SmtpClient("smtp.office365.com", 587);
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = new NetworkCredential("<login email>", "<login password>");
client.Send(mail);
Dts.TaskResult = (int)ScriptResults.Success;
}
ps: swap and as I am not sure which one comes first.
another sample of code is available in this SO answer (not tested by me)
this can easly be achieved using execute sql task. first create a stored procedure and execute sp_send_dbmail in your newly created procedure. this sp requires many parameters .. pass the values of these parameters from ssis and u will be good. please search more on google about this procedure . u can even send attachments on this procedure
We have set up Odoo 8 as a multi-user helpdesk tool, which creates a new project issue for each incoming mail. Incoming and outgoing servers are configured correctly and system parameters are set to
mail.catchall.domain: company.tld
mail.catchall.alias: helpdesk
mail.bounce.alias: bounce
The problem now is that every time a user comments the mail thread to answer the original issue creator, a new mail is generated with header
FROM: [user]#company.tld
TO: [followers]
REPLY-TO: helpdesk#company.tld
Which is totally fine but leads to a sending failure due to our SMTP configuration. To get around this we want to achieve that all outgoing E-Mails are sent from the same specified address, like helpdesk#company.tld, no matter which user response to the thread.
How do we achieve this?
I had specific issue when I was working on Odoo 8 and I found fix but its not recommended action from developer view, because changing odoo source code is not recommended and changes can be lost.
So what I did was to change email from address to real email from address. Yes it's weird but that's how Odoo works. Odoo is always sending from one specific email address and changes email from to user email address, but if you will look at email carefully you will notice that real sender is always same.
The fix is changing this line
smtp_from = message['Return-Path']
to this line
smtp_from = tools.config.get('email_from')
in openerp/addons/base/ir/ir_mail_server.py file.
PS I don't like this solution.
I have an SSIS package that sends an email when a task fails, letting me know the name of the task. I'm trying to get more specific errors. I've added the code below to my VB script task, but I never get the error.
I have a string variable set to hold the error, [User::EmailError]. I have this variable set in my task as ReadWriteVariables. I have the code below to capture the error and place it into the variable. I also have the script task property 'FailPackageOnFailure' set to true.
Try
smtpServer.Send(email)
Catch ex As Exception
Dts.Variables("EmailError").Value = ex.ToString
Dts.TaskResult = ScriptResults.Failure
End Try
I have an OnError event handler setup for the script task with a send mail task using the following expression for the messagsource.
"The Send User Email script failed with the following error:"
+#[User::EmailError]
I get the email but the variable is always empty.
Turns out my script was generating an error when assigning a 'To' email address to the mail message, which was outside the Try/Catch. I moved the Try and the error was caught and emailed successfully.
How can I configure zabbix to send me the content of a logfile in email alert? I have an alert that sends me an email when a new line is added in a logfile and I want to add the last line in the email.
How can I do this?
If you alert based on a trigger like {host:log[/tmp/file.txt].strlen()} <> 0, then you can use {ITEM.VALUE} macro to refer to the item value that triggered the alert. If there are several items in a trigger, use an indexed version of this macro like {ITEM.VALUE2} to refer to the second item in the trigger expression. The default notification message that comes with Zabbix includes these macros, so if you have not changed it, it should work out of the box.
Please see Using macros in messages section in the official documentation for more information.
We've set up a matrix job which builds our project for multiple configurations, namely Release and Debug. If one of these sub-jobs fails, the "Extended E-mail Notification" plugin sends out the following mail (${BUILD_LOG_REGEX}):
Build log lines matching "error," "failed," etc:
[...truncated 5 lines...]
Release completed with result FAILURE
[...truncated 1 lines...]
Debug completed with result FAILURE
Email was triggered for: Failure
Sending email for trigger: Failure
How do we get the actual error messages from the sub-jobs into the emails?
To get a portion of the log in the mail, if not all, set the 'Extended E-mail Notification' to send a separate email for each job that failed, and use the $BUILD_LOG in the body of the message:
In the Multi-Configuration Job, the last parameter of the 'Editable
Email Notification' is 'Trigger for matrix projects' - set it to
'Trigger for each configuration'.
In the body of the message (below the '$DEFAULT_CONTENT' ) add the parameter $BUILD_LOG to display the end of the build log
Assuming the log is in plain-text, change 'Content Type' to Plain Text
For the list of built-in Jenkins parameters, go to this page:
http://[your-jenkins-server]/env-vars.html
Cheers