Copy email logic is not working

Hi,
I am using the below code but this is not working for copy emails.
kindly help me in this regard.
package com.hbs.component;
import java.io.Serializable;
import java.util.Date;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
public class MailUtility implements Serializable
public static void sendMail(String strMessage, String strSubject, String strFrom)
          String to = "[email protected]";
          // SUBSTITUTE YOUR ISP'S MAIL SERVER HERE!!!
          String host = "smtp.XXXXXXX.com";
          // Create properties, get Session
          Properties props = new Properties();
          props.put("mail.transport.protocol","smtp");
          props.put("mail.smtp.host", host);
          props.put("mail.from",strFrom);
     props.put("mail.cc",strFrom);
          Session session = Session.getInstance(props);
          try
          // Instantiatee a message
          Message msg = new MimeMessage(session);
          //Set message attributes
          msg.setFrom();
          InternetAddress[] address = {new InternetAddress(to)};
          InternetAddress[] address1 = {new InternetAddress(strFrom)};
          msg.setRecipients(Message.RecipientType.TO, address);
        msg.setRecipients(Message.RecipientType.CC, InternetAddress.parse(strFrom, false));
          msg.setSubject(strSubject);
          msg.setSentDate(new Date());
          // Set message content
          MimeBodyPart mbp = new MimeBodyPart();
          mbp.setText(strMessage);
          Multipart mp = new MimeMultipart();
          mp.addBodyPart(mbp);
          msg.setContent(mp);
          //Send the message
          Transport.send(msg);
          catch (MessagingException mex) {
               System.out.print(mex.getMessage());

Resolved

Similar Messages

  • TS3276 My o2 email account does not work when sending from my MAC it will accept incoming mail but not send it gives me a message that  o2 account (offline) my mac I have no problem with my iPhone  or mac laptop. any suggestions please.

    My o2 email account does not work when sending from my MAC it will accept incoming mail but not send it gives me a message that  o2 account (offline) my mac I have no problem with my iPhone  or mac laptop. any suggestions please.

    Sorry for the delay...
    I did what you've told me, new account and manually copied my files from Time Machine. I had lots of permissions problems, but at the end, almost everything is in order... It seems it had to be with some of the Apple Preferences, but I can't be sure, as most of them were dumped to the trash can.
    I still don't have my Mail Rules back, unfortunately, although I did goggled some. It is a pity, as I had around 30 or 40 of them, getting my mail in order to each of its mailboxes, but it is a small price as the rest doesn't show the before syntoms.
    Thanks for the help, anyway!!

  • Multiple recipient email addresses is not working  for xsl & PDF Attachment

    multiple recipient email addresses is not working properly when
    to list has some external email address and sending xls and PDF file as an attachment.
    Test Scenario:
    (A) Create mail target activity
    1)To email : use the multiple email id with some external domain (ex.
    [email protected] ,[email protected], [email protected])
    2)File attachment with .xls file and this file is sending to mail target as an inputstream(at runtime)
    3)Use all other valid parameter in activity.
    (B) Create a process flow File source to mail target
    Execute the process flow.
    Actual Result: Mail is received by every email account. Only external email account get correct file but other email account(as ([email protected])) attachment files
    displaying message
    �abc.xls� can not be accessed. The file may be read-only, Or you may be
    trying to access a read only location. Or, the server the document is stored on
    may not be responding.�
    When i trying to open xls and PDF file
    Expected Result:
    All type of file attachments should be supported with all valid email address
    (servers).
    Pls help me about this senario:
    What is problem in this case:
    I am sending code
    Session session =getSession(host,port,secure);
    session.setDebug(this._debug);
                   Transport trans = connect(host,port,session,userID,password);
                   Message message = new MimeMessage(session);
                   InternetAddress[] iAddr = null;
                   message.setFrom(new InternetAddress(fromName));
                   iAddr = InternetAddress.parse(toUserName, true);
                   message.setRecipients(Message.RecipientType.TO, iAddr);
                   message.setSubject(subject);
                   //BodyPart messageBodyPart = new MimeBodyPart();
                   Multipart multipart = new MimeMultipart();
                   MimeBodyPart messageBodyPart=null;
    if(dataLocation!=null && dataLocation.equalsIgnoreCase("ATTACHMENT")){
                        String tmpName=fileName;
                        if( inputstream != null)
                                  tmpName = makeAttachment(fileName,inputstream);
                        messageBodyPart = new MimeBodyPart();
                        DataSource source = new FileDataSource(tmpName);
                        messageBodyPart.setDataHandler(new DataHandler(source));
                        fileName = fileName.replace('\\', '/');
                        fileName = fileName.substring(fileName.lastIndexOf('/') + 1,
                                  fileName.length());
                        messageBodyPart.setFileName(fileName);
                        multipart.addBodyPart(messageBodyPart);

    First, when sending your message, the filename should be a simple
    filename, not containing any directory names.
    It sounds like your mail server might be doing some special
    processing of attachments, perhaps to prevent viruses.

  • Just bot to conver to Word.  All I get is invite to purchase again.  email links DO NOT WORK!

    HOW DO I GET STARTED?  I JUST BOUGHT TO CONVERT PDF TO WORD.  ALL I GET IS INVITE TO PURCHASE AGAIN.  EMAIL LINKS DO NOT WORK!

    Reply from Keygames.
    Hi David,
    It is a problem with the website. We are working on a solution.
    Best is to go to http://spele.nl for the time being.
    Best regards,
    Lorenzo
    Date: Sun, 17 Nov 2013 01:43:55 -0800
    From: [email protected]
    To: [email protected]
    Subject: Unable to play flash games. All I get is a white box. Does anyone have a solution?
        Re: Unable to play flash games. All I get is a white box. Does anyone have a solution?
        created by Pat Willener in Installing Flash Player - View the full discussion

  • Copy to stickies does not work anymore

    Hello,
    As the subject says, somehow I mangled my settings so copy to stickies does not work anymore, pressing shift-option-Y. I have no idea what has changed, restoring the keyboard shortcuts to their default didn't help. Does anyone have a suggestion or a solution?
    Kind regards,
    Menno Tillema
    iMac   Mac OS X (10.4.3)  

    You can open the firefox instead of the safari. It works. However, they should solve this problem. Another bug, after saving the document, don't expect to have the figures and tables in the same place when you reopen it.  THIS WAS THE WORST SOFTWARE VERSION EVER! I am totally upset. It is worst than powerpoint now.

  • HI,Have 10.10.3 version email system does not work at all it display emails up to the installation of the new version, no incoming or outgoing emails

    HI,
    Have 10.10.3 imac version- email system does not work at all it display emails up to the installation of the new version, no incoming or outgoing emails

    That helped thanks-
    I was able to solve this by deleting all "Envelop Index*"- and "ExternalUpdates*"-files in ~/Library/Mail/v2/MailData. After that I restarted Mail and let it reindex all mailboxes.

  • HT204187 Email account does not work on the Mac but works on my iPad and iPhone. The account information was added on the Mac. I keeps rejecting my password.

    I have seral email accounts on my Mac. One does not work on the Mac but works on my iPad and iPhone. The account information was added on the Mac. I keeps rejecting my password.

    You don't input the information in manually for iCloud mail. It is automatically set up for you when you sign into iCloud via System Preferences and choose the Mail checkbox. Sign out of iCloud or deselect Mail in iCloud preferences. Open Mail's preferences and choose accounts tab. If iCloud account still exists in the list, delete it. Sign back into iCloud or check the box for mail. The account will be auto created for you.

  • Inbound email configuration is not working in SAP CRM 7.0

    We have issue with the Inbound mail in SAP CRM 7.0, the emails from external ID (eg *@gmail.com) unable to receive in SAP Mailbox.
    SMTP Settings as per the note : 455140 have been done and its working fine, we are able to send email from SAP to external server.
    Also as per the note 607108 telnet test was successful and we can see the email in SOIN,
    However if we send a mail from Gmail to SAP it is not visible in SOIN and it is bouncing back with error
    said: 553 5.1.8 <[email protected]>... Domain of sender address
        [email protected] does not exist (in reply to MAIL FROM command)
    I have attached screenshot of the SOIN.

    Hi Garcia,
    I have checked with the Network team who manages Exchange server and they have mentioned that it is bouncing back from our CRM host with the error as below,
    said: 553 5.1.8 <[email protected]>... Domain of sender address
        [email protected] does not exist (in reply to MAIL FROM command)
    Regards,
    Arpit

  • Droid Mini notifications for email and text not working

    I am having a problem with notification sounds not working for email and text messages with my Droid Mini. I took my original phone to the Verizon shop. They did a factory reset. Sound worked for two days. Went back to Verizon and they reset it again. But they did tell me if it happened again to call Verizon and they would send me a new phone. Well it happened again. Got my new phone just last week. Well yesterday and today the sound notifications for text messages and email is not working on the new phone.  Last night I powered the phone off and back on and all was working well until this morning.
    This is very upsetting as I really do like this phone. Would like to know what is going on with it. Have checked all the volumes and they are all up.
    Is there a fix for this.
    Thank you.
    Barbara
    Edited to start new discussion and private info removed as required by the Verizon Wireless Terms of Service
    Message was edited by: Admin Moderator

    For Gmail it is: open Gmail > menu > settings > your gmail address > notifications check box is unchecked.
    There are some additional notification options for labels too.

  • Email and BBM not working

    Hi,
    My email services and Blackberry messenger are still not working, despite the fact that the disruptions of last week have apparently been fixed. However, I am able to access the internet.
    On the setup menu it says that there are two email accounts, but when I click on it, it says that there are no activated accounts and there is only the option for enterprise activation. The Blackberry and 3G sign at the top of the screen are present and in capitals. I have tried pulling out the battery and rebooting. I have re-registered with the host routing table. I have also called my carrier (t-mobile), who have said it is not a problem with them.
    It's been over a week now that my phone hasn't been functioning properly. Can someone please help?
    Thanks

    Hi and Welcome to the Community!!
    I suggest the following steps, in order, even if they seem redundant to what you have already tried (steps 1 and 2 each should result in a message coming to your BB...please wait for that before proceeding to the next step):
    1) Register HRT
    KB00510 How to register a BlackBerry smartphone with the wireless network
    2) Delete and Resend Service Books
    KB05000Delete the service book for the BlackBerry Internet Service email account from the BlackBerry smartphone
    KB02830 Send the service books for the BlackBerry Internet Service
    3) Batt Pull Reboot
    Anytime random strange behavior or sluggishness creeps in, the first thing to do is a battery pop reboot. With power ON, remove the back cover and pull out the battery. Wait about a minute then replace the battery and cover. Power up and wait patiently through the long reboot -- ~5 minutes. See if things have returned to good operation. Like all computing devices, BB's suffer from memory leaks and such...with a hard reboot being the best cure.
    Hopefully that will get things going again for you! But, I am distressed by one thing...
    s-k wrote:
    I have also called my carrier (t-mobile), who have said it is not a problem with them.
    For them to successfully fob you off that way is, IMHO, inexcusable. Regardless of where the root of the problem is (e.g., the RIM network or the carrier network), your carrier remains responsible for ALL of your services and support. After all, you pay them every month for your services...they are not delivering those services. Only they have the ability to seek for you any support from RIM...you have no direct channel to RIM...only via escalation from TM can you get support from RIM. It is so sad that so many CSR's at carriers are responding like this and fobbing their paying customers off. I encourage you to ring them back up and impress upon them that your service and support contract is with them...and they are responsible for providing that support and service, including escalation into RIM if necessary.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Email notifications are not working anymore

    Hi guys,
    I use Grid Control 10.2.0.2 on Windows, and email notifications for critical alerts are not working anymore.
    I didn't change anything to the OMS configuration, it just stopped one day, and when I ask for a test email (in "Setup -> Notifications methods" of in "Preferences") it is successfully delivered.
    I didn't find anything related to this in log files, and nothing that could help here or on metalink.
    Can anyone help about that weird issue ??
    thanks in advance
    Antoine

    Have you gone back over your notification rules?
    have you tried just creating a new notification rule and testing it?
    Also take a look at Note:356774.1. If you've applied any patches (or done partition maintenance) you may have inadvertently lost all your jobs, which will break the email notications.
    If still no joy, then try Note:285093.1.
    let us know how you get on.

  • Email notification mail not working in case of customer repository

    Hi Experts,
    We have the system MDM 7.1 SP06, we are not able to get the email notification for customer repository. For other repositories like material & vendor mails are working fine. I Have checked the following steps.
    1) Added notification step to the workflow between processes.
    2) Verified the email addresses of the workflow owner and the receiver of the notification.
    3) Verified that the mds.ini has the "MailServer=" setup to the right smtp.
    I have check in workflow history, it is showing notify step but not showing details of mail like send to, mail body. While in case of material repository, it was showing complete details like send to, mail body & all.
    Previously mails for customers were working fine. Kindly suggest the solution.
    Regards,
    Gaurang

    Hi Gaurang,
    Are the time parameter same for all the repositories?
    Create a dummy user and dummy workflow,and try to send mail from that workflow.
    If this works with some id then check with the Admin id which you are using.
    This way you can eliminate the possibility of id not working.Also it will tell you that user is corrupt or not.
    Check for log and traces,kindly provide with the post here.
    Thanks,
    Ravi

  • Office Jet Pro 8600 Plus Scan to Email Setup, website not working.

    When setting up scan to email. 
    The first question is: Is the HP software provided with the printer installed on the network-connected computer?
    The answer should be yes, but we can't follow the steps of opening up the software on the computer and acessing scanner options like the printer tells us to. 
    Anyway, in the past I have set up a two users by selecting "No" to this question then it provies me with a website to enter in:
    http://192.168.5.158
    This is the current address it is giving me. This has worked for me in the past and have had no issues setting it up this way. But now (after my employer changed my email address) my scan to email is no longer working and I am trying to set it up again with my new email. 
    Every time I type in the given address: http//192.168.5.158 I receive an error message. 
    [Fiddler] The socket connection to 192.168.5.158 failed.
    ErrorCode: 10060.
    A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.168.5.158:80
    I had found a forum that had supposedly been a solution where they said to remove web services on the printer and re-set it up, this did not work at all. Still can't set up a scan to email. I just want to use the site given like I normally do, and set it up that way, I need help as SOON as possible please

    Hello rachelhuver,
    Welcome to the HP Support Forums!
    Regarding the issue connecting to the Officejet Pro 8600 Plus's Embedded Web Server to change the Email used for Scan to Email, I would like to see if I can help.
    If you touch the Wireless icon on the printer, is the I.P address the same as you noted in your post? If not, use that I.P in an attempt to access the needed page.
    If you are still unable to load the page, try using a different web browser on the computer. For example, if using IE, try Firefox.
    If you are still unable, it would appear to me that the network is blocking this page from you. You can get around this by connecting temporarily to the printers Wireless Direct network. To connect to this;
    Touch Setup
    Network
    Wireless Direct
    On with no security (I suggest)
    Connect the computer to the printer's network, ie HP-Print-**-Officejet 8600 series.
    Open a web browser (don't worry if you get a message about no Internet), enter this I.P: 192.168.223.1 and hit Enter.
    You should now be able to access the Embedded Web Server of the printer, make your changes and apply them.
    Hope this helps,
    JERENDS
    I work on behalf of HP
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to the left of the reply button to say “Thanks” for helping!

  • Copy and paste buffers not working correctly in iOS 8.1m

    Both iPads2's in my family arsenal are exhibiting what I believe to be a bug in the iOS8.1 (perhaps corrected by 8.1.1?), in the cut/copy & paste buffer stack.
    When invoking the operation to copy and paste data from one application to another, the paste action consistently selects the previous (e.g., stack level 2 rather than 1 or Top) data as what is to be pasted.
    In other words, if you have used the copy and paste routine twice, the second pasting will supply one with the paste data from the first operation, rather than the desired data from the second copy and paste operation.
    Copy and paste appears to work correctly from within a single application, but consistently fails when copying data from one application to another.
    Does anyone know of a work-around for this bug? Is it a bug that others have identified? Is there a new selection filter menu option for copy and paste operations, and what method is used to invoke the menu?
    I hope this is addressed soon, as I use Cut/Copy & Paste operations extensively (I've already had Carpal Tunnel Release surgery once and don't relish a repeat performance, no matter how successful the first was in correcting the damage).
    Any clues as to what's going on here?
    thanks in advance,
    labernache

    All you can do is simply see if iOS 8.1.1 helps you with this. With some people it has, and others it has not. I would also recommend doing a clean install of your system, too.
    Follow this procedure for a Troubleshooting Methodology ... basically reset to factory default condition -BUT- be sure to do the following methodically and also to follow the part with Apple Support!
    First you want to make sure you have several backups of your data and done with a couple of "different" sources. Be sure to understand what data is backed up and what is NOT on iCloud Backup and iTunes Backup. Use a variety of methods for backup ... you might check into Dropbox, in addition to your Apple options.
    Then turn off your desktop anti-virus software when using iTunes for this reset to factory default. After you do that reset, then leave your iPad in its factory default state and see how it operates then. If you encounter any problems in that factory default state, then take it to Apple Support, and let them know that you have just reset it to that state with iTunes and have not put any of your data back on and it is operating in this fashion (whatever the problem is) in that pristine state. Make sure you keep that trouble ticket number, because if it has to be escalated through Apple Support, you're going to find all communications tied in with that number. If the lower level help isn't able to help you, then escalate it to a higher level to examine the problem. Keep at it with that trouble ticket number until Apple Support arrives at a solution to that problem. Be methodical and keep at it.
    On the other hand, if everything is okay with the factory default condition, then restore your backup. Some people have discovered that the problem resides in the apps or something in the restored backup. If that's the case, then it's going to be trying and difficult to find out which developer's app is causing you the problem. And ... it's true ... that a developer not following Apple's instructions and guidelines for his app can CAUSE YOU TROUBLE. This kind of thing does happen from developers, especially when a new system upgrade comes out, because some developers ignore what Apple tells them about changes coming, and what they do BREAKS SOMETHING.
    This is a troubleshooting methodology that you are going through. See it through to the end.
    Choosing an iOS Backup Method (Should I Use iTunes or iCloud to back up ...)
    https://support.apple.com/kb/HT5262
    Back up and Restore your iOS Device with iCloud or iTunes
    http://support.apple.com/kb/ht1766
    iTunes: About iOS Backups
    http://support.apple.com/kb/ht4946
    Create and Delete iPhone, iPad and iPod Touch Backups in iTunes
    http://support.apple.com/kb/ht4946
    iOS: Troubleshooting Encrypted Backups
    http://support.apple.com/kb/TS5162
    Use iTunes to Restore your iOS Device to Factory Settings
    http://support.apple.com/kb/ht1414

  • Copy and Paste does not work in filter statement of table data

    I am using SQL Developer 3.0.04. I can not copy nor paste in the filter criteria when watching or editing table data. Is it a bug or do I have to change some settings?

    Hi Sven,
    I did a bit more research and now I hope we will be talking about the same thing. Bear with me and let me clarify. In terms of my prior comment about the process necessary to copy a value from a data cell into the clipboard, I was totally off-base. Once the focus is on a data cell, all one need do is Edit menu|Copy or ctrl-c. I have no idea why I had trouble with that yesterday.
    Anyway, getting back to what's relevant with regard to your issue:
    1) If something is in the clipboard, then both Edit menu|Paste and ctrl-v work for a data cell target.
    2) If something is in the clipboard, then Edit menu|Paste fails for a data tab filter target.
    3) If something is in the clipboard, then ctrl-v works for a data tab filter target.
    So obviously conditions exist where pasting to the data tab filter can work. But here is a scenario where I found a problem similar to what you describe:
    1) For the EMP table in SCOTT, display all employees in the data tab.
    2) Apply a filter. For example, filter on JOB='SALESMAN'. Now 4 salesman, all in dept 30, are displayed.
    3) Next you decide to view only employees in dept 30.
    4) Copy the value 30 from the DEPTNO column. Carelessly put the focus on ENAME column in one of the data tab rows.
    5) Next focus on data tab filter to blank out JOB='SALESMAN' predicate. Drop down to select DEPTNO. Append an = sign.
    6) Finally Edit menu|Paste. Instead of seeing DEPTNO=30 in the filter, we see...
    7) The filter contains nothing and is disabled (greyed out).
    8) The ENAME column of the prior focus now contains the value 30 rather than the a salesman's name.
    Your case may be different/more complex, but at least this simple case demonstrates in a repeatable fashion what I noticed but didn't describe very well yesterday. I have logged the following internal bug:
    Bug 12753266 - EDIT MENU PASTE INTO DATA TAB FILTER DOES NOT WORK AND MAY DISABLE THE FILTER
    Using the rollback button, blanking out any filter value and hitting enter displays all original employee rows.
    Regards,
    Gary

Maybe you are looking for

  • Bug in "look up" functionality in textareas in safari

    The first word on a new line of a text area displays funny (highlights NOT where the word originally was) if you use the "look up" functionality (triple-click). See images below. Using safari 5.1.3 (7534.53.10) and OSX 10.7.3.

  • Quantity Tolerance limit for goods receipt

    Hello Friends, We are working on the stock transport order scenario, and the steps are as below 1. Stock Transport Order 2. Outbound Delivery 3. Post Goods Issue 4. Inbound Delivery 5. Goods Receipt In our scenario, we were not maintaining any price

  • Can't get sound on tv from notebook

    I have a HP 2000 Notebook PC running Windows 8. Hooked up to Magnavox tv thru HDMI cable.  No sound on tv, only on laptop.  Is there a way to correct so I can get sound thru tv?

  • Adobe Design Std CS6 6.0 WIN ESD LRE

    We have purchsed Adobe Design Std CS6 6.0 WIN ESD LRE  and after installation adobe acrobat pro often gets crashed which need to be re-installed

  • The surface of my mouse will not scroll

    For some reason I am unable to use the surface of my mouse to scroll up or down any apps so I cannot get to the bottom of this screen