0

I have an SSIS package, that takes data from the database and then, using script component saves it into a variable (basically, following this guide). This variable is then sent as a body content of the email (using send mail task).

This body content is basically a CSV file:

BUOYID,55073,UTCDATE,23/06/2015,UTCTIME,22:42:00,STATUS,E0000.

Unfortunately the recipient cannot process it, because it's encoded with Base64 and he requires (let me quote it from the email):

Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

How can I change the package? Should I put the send email into the script?

Community
  • 1
  • 1
Yasskier
  • 791
  • 1
  • 14
  • 36
  • answering your own question is allowed (even encouraged) here on SO so I'd recommend posting your edit as an answer and even accepting it – Mike D. Jun 24 '15 at 02:39

1 Answers1

0

I solved it by removing the Send email task and adding this code to the script task:

 MailMessage emailMsg = new MailMessage();
        emailMsg.To.Add("someonesemail@a.com");
        emailMsg.Subject = "My Subject";
        emailMsg.From = new MailAddress("mysendermeal@myserver.com");
        emailMsg.Body = message;
        emailMsg.BodyEncoding = System.Text.Encoding.ASCII;
        emailMsg.IsBodyHtml = false;

        SmtpClient smtp = new SmtpClient("MY-SMTP-SERVER");
        smtp.Send(emailMsg);
Yasskier
  • 791
  • 1
  • 14
  • 36