Related to the post above. We’re using Office 365/Exchange for most of our email sending. (Website, devices, printers, etc.) All work using a dedicated email address noreply@domain.com.
I want to switch over our last thing using SMTP - Epicor - to office 365. And it works fine so long as the From address and reply-to address are the same as the smtp user noreply@domain.com. Which is okay for most emails.
Except PO emails. Because they send on behalf of the PO creator in epicor.
I’ve read in the post to setup an internal relay server, but that won’t work for us.
Or use sendgrid. We have really had bad luck with sendgrid and mailgun. We have a Pro account and a dedicated IP.
Every time I get a new dedicated IP, the IP is on the UCEPROTECTL3 blacklist. Tried multiple times and we always end up with a blacklisted IP. I’ve talked to sendgrid multiple times, they say to UCE and UCE says to talk to sendgrid. I get no where. We have some clients with a strong spam filter and because of the UCE listing, sometimes emails get blocked or flagged for spam. Really annoying.
I’d like to get away from sendgrid/mailgun and send just thru office365 but I also understand it’s not an open relay either.
Unsure what other options we got. Is there any way to make this work?
Direct Send can only send to INTERNAL email addresses, Relay can send to both.
I recall also in O365 you have to enable an email address mailbox to “Allow External Forwarding” on the address you are using.
We are using it in Kinetic Cloud without issues thus far.
Maybe these will help a bit.
Differences in Direct Send and Relay:
Good Luck. I also have setup a simple SMTP Server before using IIS on one of our servers, set the Firewall to allow ONLY that address to send mail and ONLY the internal Epicor Server to send through it. We are cloud based now, so whole different ballgame, lol
We’re cloud based too. And we’ve moved everything to the cloud to make life easier. Only issue is email really.
I looked at the lazyadmin post previously. Thought about it, for now we’ll just use sendgrid. Whether I like it or not. It’s dumb we’re spending $90 a month to just send email from epicor but there isn’t a better option. And it seems like microsoft is going to crack down on smtp relay sending at some point based on what I’ve read.
Looking into an azure smtp relay service right now. Unsure if that will work better or not.
I could do that now with SMTP. My hang up with it is, if we add someone new, someone will have to remember to add them to the send of behalf of list. Which I know won’t happen. So that won’t work.
So I may be missing the point of what you’re looking for. I’m no expert on SMTP. If you’re looking for a way to send emails from Epicor from a different email address on the same domain, I had to do that a while ago and was able to make a function using the System.Net.Mail class. This is an older version, I’ve refined it a bit since I posted this, but it does the job. Hopefully it helps.
/*===========================================================================
Assemblies: None
Services: None
Usings:
using System.Net;
using System.Net.Mail;
using System.IO;
Request Parameters:
(System.String) sendFrom: Sender email. May Include Display Name
# For display name, format as "Display Name <display@name.com>"
(System.String) sendTo: Email Destination
(System.String) sendCC: ';'-Separated Copy Email Addresses
(System.String) sendBCC: ';'-Separated Blind Copy Email Addresses
(System.String) Subject: Email Subject Line
(System.String) Body: Email Content/Body
(System.Boolean) isHTML: Is it HTML
(System.String) AttachmentList: '~'-Separated list of Attachments
# Attachments must have Full Path + Name + Extension
# Example: @"C:\EpicorData\Temp\Attachment.pdf"
Response: None
--Kevin Veldman <kveldman@hanger.com>
===========================================================================*/
// using System.Net;
// using System.Net.Mail;
// using System.IO;
// Split "Display <address>" Format for MailAddress Class
bool hasDisplayName = ( sendFrom.Contains("<") && sendFrom.Contains(">") );
string sendName = string.Empty;
if ( hasDisplayName ) {
int Start = sendFrom.IndexOf("<", 0) + 1;
sendName = sendFrom.Substring(0, Start - 2);
sendFrom = sendFrom.Substring(Start, (sendFrom.Length-Start-1));
}
// Get MailAddress for sendFrom
var mailFrom = ( hasDisplayName? new MailAddress(sendFrom,sendName): new MailAddress(sendFrom) );
var message = new MailMessage( mailFrom, new MailAddress(sendTo) );
message.Subject = Subject;
message.IsBodyHtml = isHTML;
message.Body = Body;
if ( sendCC.Length > 0 )
foreach ( string cc in sendCC.Split(';') )
if(cc!="") message.CC.Add( new MailAddress(cc.Trim()) );
if ( sendBCC.Length > 0 )
foreach ( string cc in sendBCC.Split(';'))
if(cc!="") message.Bcc.Add(new MailAddress(cc.Trim()) );
if ( AttachmentList.Length > 0 )
foreach ( string file in AttachmentList.Split('~') )
if(file!="") message.Attachments.Add( new Attachment(file) );
// Use .NET's SmtpClient Class for Domain Emails
var kvp = new Dictionary<string,string>() {
{ "email1@domain.com", "password1" },
{ "email2@domain.com", "password2" }
};
var smtp = new SmtpClient( "smtp.office365.com", 587 );
smtp.UseDefaultCredentials = false;
smtp.EnableSsl = true;
smtp.Credentials = new NetworkCredential( sendFrom, kvp[sendFrom] );
smtp.Send( message );
message.Dispose();
Yes email security is on everyone’s mind and MS also has limits you need to set for Maximum emails per emailbox as well so you don’t get shut down as SPAMMER.
O365 has Sending Limits that you need to adjust as well as Message Size limits and Recipient Limits.
I would debate going Cloud is “Easier” lol, but yes sometimes you need to get a service to send a large qty of messages. I used IIS on local Server and it worked well for us. O365 and Auth are an issue to pass through sometimes. I have also used IIS SMTP Server for Copiers sending scanned images as well, since O365 is so hard to get set up and reliable.
SMTP from printers and copiers has been flawless for us with O365.
Challenge is only Epicor and also how our PO data directive is setup. I know it’s not an option but if I could send the POs from the SMTP user email (noreply@domain.com) and use that as the reply-to, it would work. And then CC the email with who ever created the PO so if the vendor replies, then they get it but that also assumes they hit reply all.
Cloud has been mostly easier because we can easily spin things up, add services, and we don’t need to maintain the server in a closet somewhere. Maybe not perfect but it works.