How to avoid attachment with code e-mail
HelloI wrote a code for sending email notification. Code works very well as e-mail is triggered as expected, but when the mail is received an attachment called attzurlm.dataccompanies. give pointers how to remove this attachment.
PFB code
public String sendEmail (list < String > recipientList, subject to the String, String message, String to, String cc, String logoPath, Logger LOGGER) {}
try {}
functionName = "sendEmail ()"; "
Set the smtp address host
Properties props = new Properties ();
Useful util = new Utils();
Extraction of search values
tcLookupOperationsIntf lookupIntf = (tcLookupOperationsIntf.class) Platform.getService;
String smtpHost = util.getLookUpValueByKey ("LookUp.EmailInfo", "CG_EMAIL_SERVER", lookupIntf, LOGGER);
LOGGER.debug (functionName + "SMTP host name:" + smtpHost);
props.put ("mail.smtp.host", smtpHost);
props.put ("mail.smtp.auth", "false");
create properties and get the default value of Session
A session = Session.getDefaultInstance (propellers, null);
session.setDebug (debug);
create a message
Message msg = new MimeMessage (session);
Check if the cc is required
If (cc.length ()! = 0) {}
InternetAddress ccAddress = new InternetAddress (cc);
msg.setRecipient (RecipientType.CC, ccAddress);
}
set the from and to address
InternetAddress addressFrom = new InternetAddress (from);
msg.setFrom (addressFrom);
InternetAddress [] addressTo = new InternetAddress [recipientList.size ()];
for (int iCountMail = 0; iCountMail < recipientList.size (); iCountMail ++)
{
addressTo [iCountMail] = new InternetAddress (recipientList.get (iCountMail));
}
msg.setRecipients (Message.RecipientType.TO, addressTo);
Definition of the object and the Content Type
msg.setSubject (subject);
msg.setText (message);
MimeMultipart multipart = new MimeMultipart ("related");
first part (html)
BodyPart messageBodyPart = new MimeBodyPart();
String htmlText = "< br >" + message + "< BR > < BR > < P align =------"left\"> ' + ' < br > < img src =------"cid:image\"> < br > < br > ' + '< /P >";
messageBodyPart.setContent (htmlText, "text/html");
multipart.addBodyPart (messageBodyPart);
messageBodyPart = new MimeBodyPart();
MSDS of DataSource = null;
try {}
SDS = new FileDataSource (logoPath);
} catch (Exception exe) {}
LOGGER.debug ("function: + sendEmial: logofile path is missing" + logoPath);
}
messageBodyPart.setDataHandler (new DataHandler (SDS));
messageBodyPart.setHeader ("Content-ID", "< image >");
multipart.addBodyPart (messageBodyPart);
put it all together
msg.setContent (multipart);
Transport.Send (MSG);
LOGGER.info ("Email sent to the recipient:" + recipientList);
} catch {(MessagingException msgExc)
LOGGER.error (functionName + "error occurred when sending email:" + msgExc);
msgExc.printStackTrace ();
return to 'ERROR ';
} catch (Exception exception) {}
LOGGER.error (functionName + "error occurred when sending email:" + exception);
exception.printStackTrace ();
return to 'ERROR ';
}
Return "SUCCESS";
}
Check if the sons of logoPath to attzurlm.dat, if so, attach the file.
Tags: Java
Similar Questions
-
I can't send pictures as an attachment with Windows Live Mail.
This I get the error message:
Server: 'smtp.talktalk.net '.
Windows Live Mail error ID: 0x800CCC0E
Protocol: SMTP
Port: 25
Secure (SSL): No.
Socket error: 10060Sometimes, I can send a picture at the time, but not always. I tried to send a file attached and also as a photo album.
Hello
The best place to ask your question of Windows Live is inside Windows Live help forums. Experts specialize in all things, Windows Live, and would be delighted to help you with your questions. Please choose a product below to be redirected to the appropriate community:
Looking for a different product to Windows Live? Visit the home page Windows Live Help for the complete list of Windows Live forums at www.windowslivehelp.com.
-
How my HP8620 come with one e-mail address? How can it be reversed and deleted
I don't want an e-mail addreww for my printer how the ILO can be removed...
Hello
The printer email address is for ePrint, if you do not want to use ePrint you can access your connected HP account and don't allow you to send to her address, then no one can send anything to it. You need a day.
Kind regards.
-
How do I attach with a Nikon D300S using lightroom and El Capitan?
Hello
It seems to be a problem tethering Nikon D300s with lightroom using OS El capitan. Can someone give me a clue on how to find a solution.
Work on Friday where I need to tie it.
I would like to use Lightroom 3 if possible.
Thank you
We just released 6.4/2015.4 Lightroom which solves the problem of strap Nikon with Lightroom running on Mac OS 10.11.
Please see Lightroom CC 2015.4 / 6.4 available
Kind regards
Mohit
-
How to avoid that new repaired dissappearing mail folders
All e-mail folders deleted.
Open each Properties folder and run 'repair file' which restored the contents of the file but when I go to a different folder to restore that one and then return to the previous folder, it is 'empty' again. That is to say the restoration is not permanent.
Tried to delete the .msf files but the problem persists.Read this article on the maintenance of your messaging system. What you describe is caused by corruption and is often the result of a neglected system.
http://KB.mozillazine.org/Keep_it_working _ (Thunderbird) -
How to avoid that don't Junk mail 2 weeks instead of him be removed without seeing me
I want to see my junk mail. I want to keep 2 weeks. Sometimes my Inbox oes does not recognize an address then it started in my junk e-mail folder.
Move it to your Inbox and leave for 2 weeks then either brand is also undesirable, or remove.
-
I tried to use the uSB cable, but Lightroom does not recognize the camera. My memory card has no images on it that I read somewhere that it can slow things down if she has no images on it
If you use Lightroom CC / 6 on a Mac OSX El Capitan you must update to the latest version of CC 2015.4 / 6.4. Problems with Nikon capture home has been fixed in the latest update, the lis below.
Lightroom Journal | Tips and advice straight from the Lightroom team.
-
How to scan with my MG5620 for attachment to an e-mail message to send with my chrombit (wireless connect)? I guess I have to be able to drop on my Google Cloud someway.
Thanks, I'll do the application of inkjet Canon a try.
-
How to read an attachment with Adobe Acrobat in my e-mail address?
How to read an attachment with Adobe Acrobat in my e-mail address?
Hi hand hunter.
If you have PDF attachment with your email and you use windows.
Try make first right click on any PDF document and select the option Openwith--> choose default program... Find a Reader / Acrobat. That should help him.
Or click on the attachment and once you are trying to open what should ask you to choose the application open with if you have not opened before PDF document.
Kind regards
Ajlan Huda.
-
How to pass a string of e-mail with attachments?
How to pass a string of e-mail with attachments? I received an email and had answers in both directions. I try now to send the original of the attachments on the first 2 emails. How do I do that? My receiptiant says that he gets the e-mail message but has no attachments?
You don't mention what you use for e-mail.You can either transfer the messages all attachments, or save attachments and then attach them to a new message. -
How to open an DS_STOREFile attachment to an e-mail message in Outlook Express 6?
I got the DS_STOREFile with pictures as an attachment in an e-mail message in Outlook Express 6. How can I open it?
First save you it to disk. Then, you need to ask those who sent him this program to use to open it. You can then right-click on it and go to properties and click the button change to set the appropriate program. If it has a file extension that would help a lot of things, but if not, you will need to ask the sender.
Steve
-
I can't download photoshop elements because it keeps saying 'you're not connected to the internet. Well, if I'm not how did I get this far? No problem with Safari or Mail.
Please read https://forums.adobe.com/thread/1499014
-try some steps such as changing browsers and disable your firewall
-also clear the cache of your browser if you start with a fresh browser
-check the file hosts for blocked entries https://forums.adobe.com/thread/1912777
http://myleniumerrors.com/installation-and-licensing-problems/creative-cloud-error-codes-w ip.
https://helpx.Adobe.com/creative-cloud/KB/creative-cloud-desktop-application-failed.html
http://helpx.Adobe.com/creative-cloud/KB/failed-install-creative-cloud-desktop.html
-
How can I sync my iPhone with my mac mail
iPhone 6s (iOS 9.3.4), McBook Air (El Capitan 10.11.6)
How can I sync my iPhone with my mac mail without using iCloud?
I use several 'GMX' and 'Web' of e-mail accounts.
When I send email from my iPhone, they are only saved on it, but neither on the (GMX / Web) server or on my Mac.
For e-mail accounts to synchronize between devices, they must be configured as IMAP accounts. POP protocol doesn't have this capability.
-
Conditions:
2 windows of firefox open 21.0, showing 2 different pages, which comes from the same server.
One of the 2 pages it active, having shot on it with the mouse.
If I try to zoom on active windows, is enlarged also another one that is not active.
How to avoid this?Hello AngB, what you described is the expected behavior by default in firefox, since it will remember your custom of expansion on a per domain basis and apply it to every page of this area.
If you want to change it, enter about: config in the address bar of firefox (confirmed the message information where it appears) and look for the named browser.zoom.siteSpecificpreference. Double-click it and change its value to false.
-
How will I know if questionable attachment on an e-mail scam, I opened my I infected mac?
One obvious way is if your iMac behaves differently. You can download and run Anti-Malware https://www.malwarebytes.org/mac-download/
Maybe you are looking for
-
runtime error dialog box: avoid showing its parent window
Hi all Build my own GUI of TS, I use the components of TS in a VI that is never shown (running as a 'service' in my application). Another window is used as the interface main and "lives" according to orders sent by my TS 'service' VI (orders shipped
-
This question is about programming in C. you please help me with a question that is.
This question is about programming in c. can you please help me with an issue that is - Why do we write - printf ("r = c = %d %d sum = %d\n", sum c, r,); What we're trying to accomplish here by writing this. I also wanted to know why we write things
-
I need to move the Bill House of Windows XP to my new computer, I have windows Server 2003 on that now I want to pass without charge if posibleRuth RudinSecurity chip
-
Overclocking CPU and RAM upgrades!
Hello, first of all thanks for the beautiful vostro 230 desktop I bought it its been 3 years. Not a single problem with it. Its good for the last year, but now a day I am not satisfied of its speed and reliability. Lack of funds, I can just build or
-
question about sending mail and the use of UrlEncodedPostData
Hello I need to send over https three things: (1) framework, which is a byte [] object, and has some information about the device and the things that need to be sent to the server object String 2) imei - imei of the device. (3) data - some data, whic