how to find out wrong email id in mail using java - jakarta-mail

We will be sending automated emails through a mail box ,we will send an email with two to three emails in TO column and one or more emails in the CC column ,if i have a wrong email in the TO column in that mail box we will get a delivery report that email is wrong i need to write a program such that it will pick up the wrong email id

Start by reading up on JavaMail FAQ and the com.sun.mail.dsn package. The JavaMail Homepage has all of the downloads you'll need.
You could also enable the mail.smtp.reportsuccess property per the documentation:
When sending a message, detailed information on each address that fails is available in an SMTPAddressFailedException chained off the top level SendFailedException that is thrown. In addition, if the mail.smtp.reportsuccess property is set, an SMTPAddressSucceededException will be included in the list for each address that is successful. Note that this will cause a top level SendFailedException to be thrown even though the send was successful.

Related

Suitecrm Workflow - Email sending using varchar custom field option

I have a problem with the action of sending email to an email address entered in a varchar field. The option called ‘field’ in the action seems not to work. Can anyone help me understand what is entered as a parameter? I have already tried to insert several references to the field but without success.
Suitecrm workflow screen
Thank you
That option has an internal name of Record Field. I looked in the code and I don't think that option is implemented yet.
The Email addresses are stored in a specific module called Email Addresses. This module has different functionalities, such as the opt-in or rejected options. And it has a relationship by default with the modules Users, Contacts, Accounts, Leads.
I don't think SuiteCRM can send an email using the address from a text box.

Remove "[External]" tags added by email server

My organization has begun adding obnoxious warnings to the subject and body of any email that arrives from an external address. My organization allows email forwarding, and I forward to gmail. I would like to have the extra text automatically removed before I see them in gmail. This would not violate the policies at my organization. Some ideas I had:
(1) One option would be to set up a gmail filter that edits the message. This feature does not seem to exist.
(2) Another option would be to customize the display so that this particular text is never shown on the screen. Again, there seems to be no way to do this.
(3) I wrote a script in Google Apps to grab to the content of each offending email and send an edited version to myself, but there is no way to make the "from" field show the original sender (perhaps with good reason). I can put that information in "reply to" but the gmail client doesn't show it nicely. This removes the annoying extra text at the cost of the ability to easily see who sent the email. The core of it is this call:
GmailApp.sendEmail("<my_email_address>",newSubject,newBody,{
attachments: message.getAttachments(),
bcc: message.getBcc(),
cc: message.getCc(),
htmlBody: newBody,
replyTo: message.getFrom(),
});
Any ideas? This is becoming a big problem as the "nanny state" approaches, so I'm sure others will appreciate your solution.
Issue
It unfortunately seems that at the day of this post, there is no way of edditing a forwarded email with the Gmail API. Check the documentation to see what you can actually do with the Gmail API in regards to forwarding email addresses.
Workaround
Despite it is not possible to edit a forwarding email address, in your case you are interested in:
Edit the body and subject of the email address.
Preserve the information of who the sender was.
Therefore what you could do is:
Get the email address you want to edit. Get the body, subject and information about who was sending it and store that.
Create a new message where you edit the message you just got and write on the subject the from field that was in the message you just got.
Send that created message to your desired recipient just like it was a forwarding email.
I hope this has helped you. Let me know if you need anything else or if you did not understood something. :)
Apps Script
You can insert messages into your inbox with their original "From" field but a modified body.
Note: Inserting is different from sending because the message is created on the inbox with less validation than sending.
To use this on Apps Script, take a look at the Advanced Gmail Service.
Custom Application
Another idea on how to do this is to use a custom application (in any language you'd prefer) that:
scans your company inbox with IMAP
manipulates the message body to remove the artifacts you don't want
insert manipulated message into your Gmail inbox with the Gmail API

How to check Outlook folder has mail or not

What Azure service allows us to run at a fixed interval (IE every 5 min), and if a given Outlook/mailbox folder has one or more emails in it, then send one notification email?
We have a Logic App that does email processing. If the processing fails for whatever reason, the email is placed into a "Failed" folder, and an email notification is sent out. The issue is when a dependent service is down, we are getting hundreds of email an hour.
We tried creating a second Logic App that runs every 5 min, sending email if it found email in the folder that is "flagged", but we still received one email per flagged email.
We are thinking a separate service that runs every so often, and if a folder has email in it, then send out a single email.
Actually there is a Outlook trigger action to detect if there is an email is flagged. It supports to change the Folder,Importance,Interval and add other parameters to match.
And this is the action Optional Parameters description.

Mail sent with sp_send_dbmail shows embedded images as attachments

I'm using sp_send_dbmail to send a "welcome" email to employees' newly provisioned mailboxes. The content looks good in both Outlook 2016 and in Office365.
There is a difference from the source email I'm replicating, however, in the how the attachments appear. The source email does not show a paperclip icon or attachments in either system. The email sent with sp_send_dbmail shows the paperclip in both and lists attachments in Office365 (but not in Outlook).
I copied the HTML from the source email in Outlook and had to change the src tags to get it to work:
<img ... src="cid:image009.png#01D42E2D.8043A5B0">
This wouldn't show the images until I removed the #01D42E2D.8043A5B0. I haven't been able to find any explanation of what that part of the tag does or how to use it properly.
Is there a way to make the message sent with sp_send_dbmail appear exactly as the original does?
Edit to add:
Further testing finds that TypeApp (an Android mail client) doesn't render the images from sp_send_dbmail, but it does display the source email correctly.
I realize that email clients won't behave consistently, but why can't I make the email I send behave like the other?
A possible workaround is to use SendGrid email. It might work differently with embedded images. Not sure.
In a previous project I hit a lot of various problems with our internal Exchange server, so I just went outside to SendGrid, which worked very well. They have a free tier.

How can I track the delivery status of the sent email in "Send an email" Azure Logic App Outlook Connector

When using Azure Logic App Office 365 Outlook connector - "Send an email", is there a way to find out if the email was actually delivered or not to the recipient so as to take a specific action based on the failure?
I used an invalid email ID in the connector, but the action of sending email is shown as successful even though the email was not delivered. To confirm it is an invalid email ID, I sent email to this invalid email ID from my Outlook and I received an undelivered email message.
In the next action after this “Send an email” action, I selected the 3 options (has failed, is skipped, has timed out) under “Configure run after”. However, this action is never executed as the email sending action is always successful even though the email was never delivered to the user.
Below is a screenshot of my logic app. The bottom right action in yellow is never executed even though the email is not sent in the previous step.
Send Email Logic App
Any inputs on how I can find out if the email was actually delivered or not?
My goal here is to find out if the user actually received the email or not, and then take some action if the email delivery failed.
No, this is not possible from within the Logic App.
The only way to occasionally accomplish this is to monitor the sender inbox for NDRs (Non-Delivery Receipt). This can take minutes to hours.
Be aware, a number of email systems will not even send NDRs as they can be used to fish for email addresses.
You can use get emails action to get the latest email and you can perform the next action based on the condition whether the subject of the email we get contains the "Undelivered" string.
Sometimes it takes long to receive the undelivered report email in outlook. so i made a specific flow which will extract the wrong email that i sent the mail to and send me an adaptive card with that email provided in it.

Resources