Automatic email documents generated out of Epicor

I know many of you have done this and we are getting ready to do this here. We want to be able to generate invoices and then automatically email them to the customer. What are you using to accomplish this? We also want to be able to send off shipping documents and other docs at various times or various points within our process.

I do not care if it is expensive, cheap is always good…and if it doesn’t require a lot of work that is always best! But right now I am looking at what options are out there to do this. Thanks! Manasa

On 10 are you using SSRS?

Joshua Giese
Technology Solutions : CTO
Direct Phone: 920.593.8299
Office Phone: 920.437.6400 x342
[http://wcibags.com/email/emailFooter4.jpg]http://www.wcibags.com/

Your best bet is APM though in 10.1 epicor introduced some advanced document routing to auto print.
I know u guys are not in 10.1 yet, but it might be worth t the jump for this feature

To elaborate major difference is data you want used in the emails as content from APM you are basically doing a screen scrape it has to be on the report somewhere static can’t move. With the solution in 10.1 you are using metadata from the dataset and can pretty much do whatever the hell you want.

Joshua Giese
Technology Solutions : CTO
Direct Phone: 920.593.8299
Office Phone: 920.437.6400 x342
[http://wcibags.com/email/emailFooter4.jpg]http://www.wcibags.com/

We currently use DocuSender from DotNetIT for Invoices, PO, and ORder Acknowledgement.

1 Like

We are on 10.700.4 and we do a combination of Crystal and SSRS. Manasa

It looks like we will go down this road then…part of our upgrade…fun! M

1 Like

thanks, Miguel…at least something else to compare APM to…Manasa

If you have access to an SMTP email server, it is pretty straightforward to send email using custom C# code in BPM (I have never used built in EMAIL object). I can share code if you like.

You could always generate your report to a local PDF, then attach it in email.

Hhhmmm…Chris, I may take you up on that….would you be willing to talk of list to discuss more?

M. Manasa Reddy
P: 703.471.7145 x454
manasa@euclidsys.commailto:manasa@euclidsys.com

This is the code I used within a form customization - It should be the same except for in a BPM you can use MssageBox.Show, you have to use the ICE message box. I hope this helps! I would also like to note, you can use your GMAIL account for SMTP as well if you use the right settings. -Chris

SmtpClient smtpClient = new SmtpClient();
NetworkCredential basicCredential = 
    new NetworkCredential("uremail@domain.com", urpassword); 

MailAddress fromAddress = new MailAddress("WhoIsSender@domain.com"); 

smtpClient.Host = "mail.yourSMTP.com";
smtpClient.Port = 25;
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = basicCredential;

MailMessage message = new MailMessage();
//-------> THIS IS WHAT YOU WANT!  ---->message.Attachments.Add(new Attachment(PathToAttachment));

message.From = fromAddress;
message.Subject = "Testing customiztion from E10";
//Set IsBodyHtml to true means you can send HTML email.
message.IsBodyHtml = true;

message.Body = "<h1>This was created from within EPICOR..</h1><BR>On the receipt entry screen";
message.To.Add("receipient1@domain.com");

try
{
    smtpClient.Send(message);
}
catch(Exception ex)
{
    //Error, could not send the message
 //   Response.Write(ex.Message);
MessageBox.Show(ex.Message);
}
2 Likes

Cool, thank you….we shall try it. :smiling_face:

M. Manasa Reddy
P: 703.471.7145 x454
manasa@euclidsys.commailto:manasa@euclidsys.com

Sorry for the typo’s I meant to say you CANT use MessageBox.Show in a BPM. Also, dont forget to add these directives:

using System.Net;
using System.Net.Mail;

Pretty nice @Chris_Conn ,
For what its worth if you are in a BPM you can use the built in Epicor Mailer class to send SMTP email with attachments. This makes it a little simpler since it will use the configured Epicor SMTP settings that you’ve already established when you setup Epicor.

     var mailer = this.GetMailer(async: true);
     var message = new Ice.Mail.SmtpMail();
     message.SetFrom("email@email.com");
     message.SetTo("email1@email.com;email2@email.com");
     //message.SetCC()
     //message.SetBcc() 
     message.SetBody("<html><body><p>MyMessage Here</p></body></html>");
     Dictionary<string, string> attachments = new Dictionary<string, string>();
     attachments.Add("MyFirstAttachment", @"\\MyServer\myFolder\MyFile.pdf");
     mailer.Send(message, attachments);
9 Likes

Got it!

M. Manasa Reddy
P: 703.471.7145 x454
manasa@euclidsys.commailto:manasa@euclidsys.com

Nice, I have never used the email object - I have no control over the system configuration so I wasn’t sure if an SMTP was even configured. For future reference, is that simply configured in the SYSCONFIG? I think I saw some params for that.

The one that BPM uses is configured in Company Configuration

Mr. Gomez: Thank you so much for the code.

I ran a quick test and it works!

I must admit I was thinking this was going to be much more complicated - But it really is straight forward.

Thank you again,

DaveO

Jose,

thanks for this great information. I need assistance on this, this is the scenario:

I have a csv file in this location:
E:\Epicor\EpicorData\Companies\iei\BankVendorFile\Live\LiveVendor.txt
My server name is : ERP10-APP

I already tried
@"\Epicor\EpicorData\Companies\iei\BankVendorFile\Live\LiveVendor.txt"
@"\ERP10-APP\Epicor\EpicorData\Companies\iei\BankVendorFile\Live\LiveVendor.txt"
and does not work, no even email received.

but if I try :
@“E:\Epicor\EpicorData\Companies\iei\BankVendorFile\Live\LiveVendor.txt” , i works but i am getting an attachment that is not the one I want. it is like an video recorder installation program .dat

I am confuse because I do not where Epicor is attaching this program from.

thanks for any help on this
regards
Manuel

Are you doing this on a BPM? If so the file needs to be in the Epicor Server.