Hi in an enterprise environment we need to send smtp emails to lots of clients at the same time. the email send request originates from front end and comes all the way back to
ESB to send email.
Now we need to send response back to the front end telling that email has been sent. So wondering how smtp server sends the response back is that after placing the message in the queue or after delivering the message to the client?
this question might seem a bit strange to someone who hasn't actually been to this point. But if anyone has been to this point and found a solution i would really appreciate to know that.
SMTP is a store and forward protocol. In general, all the SMTP server does is say whether it accepted the message for delivery. But it doesn't say whether the message was actually delivered. At least, not while the SMTP client is connected to the server.
Most servers will attempt to deliver a message and notify the sender (via email) if the delivery is delayed or if delivery fails. As I understand it, they aren't required to do that. And I don't know of any server that, in the normal course of business, notifies you when a message is delivered successfully. "No news is good news," it typically the case with SMTP.
It's much like posting a letter. You drop an envelope in the mail box and hope it gets to where it's going. If the letter is undeliverable, it will (usually) come back to you. But unless you ask for a return receipt, you never know if the envelope got to where it was going ... or when.
Speaking of return receipts, remember that sending them is at the discretion of the receiver. A mail client can elect not to send the return receipt.