+1 vote

Hello,

For one of our customer we tried want to implement a complex flow were in the end, people get mails. We will use the function Efficy.sendExternalMail for that.

The customer asked me a really good question. How can we know that the mail was actually send ?

I tried this in a scheduler :

Efficy.sendExternalMail('lbe[at]efficy.com', 'lbe[at]efficy.com', '', 'hello ?', 'test test test');

Efficy.sendExternalMail('lbe[at]efficy.com', 'superman[at]efficy.com', '', 'hello ?', 'test test test');

Efficy.sendExternalMail('lbe[at]efficy.com', 'efficy[at]ab78cdefghijkl4mnokqrst.com', '', 'hello ?', 'test test test');

Efficy.sendExternalMail('superman[at]efficy.com', 'efficy[at]ab78cdefghijkl4mnokqrst.com', '', 'hello ?', 'test test test');
  1. The first one is a real address, sending to a real address
  2. The second one is a real address, sending a to a fake adresse ( I think ), but the domain exist
  3. The third one is a real address, sending to a fake address, except the domain does not exist (I am pretty sure. I didn't check :) )
  4. The fourth one is a fake address, sending to a fake address, and the domain does not exist

Here's what I can find in SYS_MAIL after the scheduler :

enter image description here

After the mail dispatcher did his job, here is what I got in my mailbox (Emails are not allowed) :

  1. First mail was obviously a sucess
  2. I got a response from the @efficy smtp for the second address
  3. Still no news from the second
  4. And the fourth, I don't expected much, but I got nothing

In sys_mails : the table is empty.

If theses mails had been sent by, my Outlook, I would have received an error for the third one.

The demand of the customer is simple. He want to be warn when an email was not successfully sent.

How can I respond to that ?

Regards,

Loïc

closed with the note: Efficy doesn't know if an e-mail is well received, until you receive replies and read them manually
asked in WorkFlow / Serverscript by (416 points)
closed ago by
Edit : I received a response for the third mail 3 hours later, with the indication "tried 5 times". So I suppose it takes time.

1 Answer

0 votes
Best answer

Hi Loic

You posed the question "Are the mails successfully sent?" but you are testing if they were "successfully received". That's two different things

If the e-mail is removed from SYS_MAILS, the e-mail is successfully delivered to the mail server. This is the same behavior as a mail that moves from your Outbox to Sent Items because Outlook just sent the mail to your own mail server.

Just like Outlook, Efficy doesn't know if an e-mail is well received, until you receive replies and read them manually. Mass mailers like Flexmail have software in place that scans these replies and register the mails as bounced.

Regards,
Kristof

answered by (6.4k points)
selected ago by
Ok thanks. I am not really aware of the behavior of a mail server. I though that, by default, there were some kind of protocol / callback when the mail successfully reach his destination.

Thanks a lot,
Loïc
1,129 questions
1,381 answers
1,642 comments
320 users