Get email ID

HI,
    How to get the email id of the currently logged in user, using webdynpro for java 2004.
How to send an email using webdynpro for java with attachments.

HI,
Use the following code for sending mail from current login user.
try{
IWDClientUser user = WDClientUser.getCurrentUser();
String mailTo = "[email protected]";
String remarkDetail = "Your proposal has been reviewed.";
String subjectDetail = "Request for new proposal ";
String mailSenderFirstName = user.getSAPUser().getFirstName();
String mailSenderLastName = user.getSAPUser().getLastName();
String host = "<put the SMTP host name>";
String mailBody = remarkDetail + "\n xxxxx xxxx xxxx xxxxx."   +"\n\n Thanks & Regards" +"\n" + " " + mailSenderFirstName +" " + mailSenderLastName;
Authenticator   authenticator = null;
// try{
// IWDClientUser user = WDClientUser.getCurrentUser();
String mailFrom  = user.getSAPUser().getEmail();
InternetAddress [ ]  addresses_from = { new InternetAddress (mailFrom)};
InternetAddress [ ]  addresses_to = {new InternetAddress ( mailTo )};
Properties  properties = new Properties ( );
properties.put ( "mail.smtp.host", host );
MimeMessage  msg = new MimeMessage (
Session.getInstance ( properties, authenticator ) );
msg.addFrom(addresses_from);
msg.setRecipients ( Message.RecipientType.TO , mailTo  );
msg.setRecipients ( Message.RecipientType.CC , addresses_cc  );
//msg.setRecipients ( Message.RecipientType.BCC, addresses_bcc );
msg.setSubject (subjectDetail);
msg.setText ( mailBody );
Transport.send ( msg );
  } catch (AddressException ae)
ae.printStackTrace();
catch (MessagingException me)
me.printStackTrace();
catch(Exception e)
Now Import the followings
import java.util.Properties;
import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
Thanks and regards
Chandan

Similar Messages

  • I keep getting the message can,t connect to server, can't get email, can't send email from outlook account on ipad

    I keep getting message cannot connect to server, cannot send email, cannot get email from my outlook account . This has been happening for past 3 days Feb 2014

    Check your internet connection...
    If you are connected but can't access anything, your WiFi must be slow.

  • Cannot get email from tiscali account

    Hi,
    I recently changed my password on my tiscali email account. i can get my emails OK on the computer but ever since I have been unable to get emails from this account on my iphone.I have changed the password on the phone, deleted and re-added account, turned phone on and off, in fact everything i can think of but still get the error message 'cannot get mail' the user name or passwordfor tiscali.co.uk is incorrect.
    i have another email account not from tiscali and i can get the emails ok , also can access internet.
    Can anyone help?
    many thanks,
    jane

    I assume that though your signature says you are running 10.4.8 you are actually running Lion or Mountain Lion? If so please amend the signature to prevent confusion.
    Go to System Preferences>iCloud and uncheck Mail in the list there: then re-check it. This should set Mail up again to access the account. If this doesn't work, sign out completely, reboot, then sign back in again. You iCloud data will disappear from your Mac but reappear when you sign back in.

  • I have installed Mountain Lion 10.8.2 but still cannot get email from my work exchange account. I'd appreciate any help.  Thank you.

    I have installed Mountain Lion 10.8.2 but still cannot get email from my work exchange account. I'd appreciate any help.  Thank you.

    You can go to the Apple online store and purcahse a copy of Mountain Lion.  This will give you a redemption code, which you can use to download Mountain Lion from the App Store.  Unfortuantely, I'm not aware of any other way to legally purchase it.  I have never seen Apple release Muontain Lion on DVD.
    In terms of Apple Service, they just need the serial number of the machine to check the purcahse date.  It is usually correct, to within a few weeks.  A quick Google search should give you the correct number to dial.
    I hope this helps.

  • I have installed Mountain Lion 10.8.1 but still cannot get email from my work exchange account. I'd appreciate any help.  Thank you.

    I have installed Mountain Lion 10.8.1 but still cannot get email from my work exchange account. I'd appreciate any help.  Thank you.

    I would delete the account and try to re-enter it. Also, you have to let your firm's IT department know that you want to sync work email on your personal devices before they actually work.

  • HT5624 Why in my email ( the one on my ipod5 that I use with my apple ID) when I get emails about my use of my apple ID to use a service in the from field it has my fathers name and when I click on it it shows his contact info ????

    Why in my email ( the one on my ipod5 that I use with my apple ID) when I get emails about my use of my apple ID to use a service in the from field it has my fathers name and when I click on it it shows his contact info ???? I also set up my apple ID with a new email account and also I signed up for iCloud but used the same apple I'd email and password but it gave me a I cloud email! I did activate the favorites in my email . Noticed the from field has my fathers name and contact and it is a notification about me using my apple ID to sign in to FaceTime! Something is messed up, not sure how or why???

    i didn't read a lot of your 2nd paragraph, but it seems like the password is the issue, right?
    do a true clean install
    reboot your machine and hold down command+option+r, you should see a spinning globe - if you don't see the globe or anything that reads internet recovery, shut down and try again
    at menu, chose disk utility and once there, find your HD on the left side, select the physical name and erase it as mac journaled
    exit disk utlity
    at menu, choose install OSX
    this time, when it asks for a password just hit continue, it will let you complete without a password
    you should be able to get into your laptop, now figure out what password you'll be able to use with your kb issue

  • HT1933 I get emails saying that there is a new show to download, but when I click on download, it doesn't work. How do I fix this?

    Long story short. I get emails for my pre-purchased TV shows saying I can download them. I click the button, it downloads into iTunes, and I watch them. Now, this isn't happening. I can purchase and download songs just fine, but when I click on the pre-purchased tv shows, I can't get them to download. Does anyone know how to fix this problem? I'm on a macbook air using iTunes 11.0.2 .

    It seems that this is a MAJOR issue with MANY end users experiencing the exact same problem - iTunes 10.5.2.11 Crossfade is completely buggy.  Apple, get it together, seriously...your QA department should all be fired for this.
    Diego, there are numerous threads replicating your problem.
    So far, there are a few work arounds:
    https://discussions.apple.com/thread/3408812?start=0&tstart=0
    One thing to keep in mind, at least what has worked for me: After you make a change to the crossfade timing, you must close out of iTunes and re-open before the new settings take place.
    Crossfade timing = 12 seconds actually equates to about 50 seconds.
    Click the slider, then use your arrow key to tick over about 20 times - this should crossfade your songs approximately 6 seconds before ending.
    Apply, then close out and re-open iTunes...
    Peruse through the link above, there are different approaches.  Maybe one will work for you.
    <Edited by Host>

  • How do I get email and text message notifications when my phone is locked?

    How do I get email and text message banner notifications on my iphone when the phone is locked? When I had iOS 6 I could get notifications with sound and banner. Now that I have iOS7 I can't see notificaitons when the phone is locked.

    See if this support document about Notifications helps. http://support.apple.com/kb/HT3576

  • Anybody had an issues with mail since upgrading to mountain lion? Can't get emails from one account, tried deleting and recreating but to no avail. Set up a new user and it works fine. Macbook pro 13" mid 2010 model.

    Anybody had an issues with mail since upgrading to mountain lion? Can't get emails from one account, tried deleting and recreating but to no avail. Set up a new user and it works fine. Macbook pro 13" mid 2010 model.

    Anybody had an issues with mail since upgrading to mountain lion? Can't get emails from one account, tried deleting and recreating but to no avail. Set up a new user and it works fine. Macbook pro 13" mid 2010 model.

  • Why am I getting Emails from Apple in turkish to an Email-address that isn't used for my Apple ID anymore ?

    Hi everybody, I already apologize if this isn't the right community for my problem.This whole thing is very confusing  so I really hope someone can help me
    I used Gmail as my official email account and it was also the Email address for my Apple-ID (for many, many years..)
    Strangely, a few months ago, I got an Email from Apple saying that my Apple-ID was being used for Imessage and Facetime on other devices (in Turkey?). I googled it and found out that it might be a fishing mail so I quickly changed my password and also the Email-adress for my Apple.ID – which means that the Gmail-account was not longer in use for Apple anymore.
    But here's the problem :  I still get Emails from Apple (in Turkish) from time to time to my Gmail- account. They don't seem to be fishing Emails, though.  Another odd thing about that is, that the mails I receive at Gmail don't seem to be addressed to my CORRECT email-address.
    While my adress looks like „[email protected]“ the Itunes mails I receive are addressed to '[email protected]“ .  I hope you know what I mean. There is no point between the names in my real address.
    What could this be and how can I solve this problem ? It's really freaking me out. 
    Thanks,
    D.

    Hi D.,
    Unfortunately phishing is far too common these days. The articles below will help you determine the authenticity of the emails that you received.
    Identifying fraudulent "phishing" email
    http://support.apple.com/kb/ht4933
    Identifying legitimate emails from the iTunes Store
    http://support.apple.com/kb/ht2075
    -Jason

  • How can I stop getting emails when adding events to iCal (Mac) or Calendar (iOS)?

    This question could just as well go to the iCloud on my Mac community...
    I put 'I' in the topic for brevity but it's actually my wife who gets emails every time either of us adds or edits events, whether we do it in iCal on either of our Macs or in Calendar on our iOS devices. Presumably this is to do with a setting in iCloud somewhere, but I've searched high and low and can’t find it. I've also compared settings on our Macs and phones and can't find anything that could be the culprit. It's driving her nuts!
    For more information, we share all our calendars so that either of us read and write any of them, and we're both on iOS 5.1 on our iPhones (hers is a 3GS, mine's a 4), and we're both on Mac OS X 10.7.3 Lion (2010 27" iMac and 2011 MacBook Pro respectively).

    this seems to be a new "bug" on iCloud.  It's happened to many users (judging by the posts here).  My wife and I have one shared calendar and we've been happily using it without the email problems (because I had set iCloud NOT to email us whenever an event changed - this was done at icloud.com, a setting there).  Recently we began getting emails.  I suspect a change in iCloud that was in error, because I just checked my setting and the option to have an email sent when an event changes is not checked.

  • TS3991 I got an email saying  my iCloud storage was full and gave me a link that I used to enter my icloud account. Now I can;t get email and the address of email is not iCloud. I think I have a virus now. Who can I contact to for help?

    The email said Icloud Customer Care but address is ________  I was stupid and didnt notice this when I went into link and singed in with apple ID and password. Now I cant get email.  Help!
    <E-mail Edited by Host>

    Apple sends no such emails. You succumbed to a phishing scam, and your Apple ID and password have been stolen.
    To recover from this will require assistance from Apple: http://www.apple.com/support/appleid/contact/
    Don’t open email attachments from email addresses that you do not recognize, or click links contained in an email:
    Most of these are scams that direct you to fraudulent sites that attempt to convince you to disclose personal information.
    Such "phishing" attempts are the 21st century equivalent of a social exploit that has existed since the dawn of civilization. Don’t fall for it.
    Apple will never ask you to reveal personal information in an email. If you receive an unexpected email from Apple saying your account will be closed unless you take immediate action, just ignore it. If your iTunes or App Store account becomes disabled for valid reasons, you will know when you try to buy something or log in to this support site, and are unable to.

  • HT5527 I've paid for iCloud storage, but keep getting emails saying my storage will be unavailable if I don't upgrade.

    I have paid $40 a year for the additional storage, but I keep getting emails telling me that on September 30th my storage will go back to the 5G unless I upgrade.  Is there another step I need to take?

    When you purchased the additional storage it over-rode and cancelled the free storage you got as a result of having been a MobileMe subscriber. You are getting these automated emails because 'the right hand knoweth not what the left hand doeth' (Ecclesiastes 11:1) - just ignore them. They will stop in another week.

  • Can get on fav website, check new items& account--but when I go to order, it won't process order. other websites no longer get get email sent to me

    Problem 1: There is a local website that I have an account with (for a long time) that offers good deals with vouchers...etc. Since I have got Firefox, I get their emails, I can go on the site and check the emails, get to my account to see what I have, delete used vouchers,etc. But than when I place order and go to my cart, I put in the couple items you always have to put in (ph# and hit x confirm by the rules)==I hit confirm order and the site doesn't take the order. It erases my ph number & x by confirm. I put it in again and does same thing. I missed out on some good deals because of this. I called the place (our newspaper) that runs this HOP On It by the Billings Gazette & they got an order through on their computer & said it has to be with my computer. Yesterday I tried to place another order and the same thing happens. Could you please tell me what is going on and how to correct this? This is an important site for me. Thank you.
    Problem 2: I have some websites I also like to get emails from for store ads & coupons (Hobby Lobby) and a site called SplitCoast Stampers. For some time now, I don't get their emails. I tried several times to resign up for the newsletters and/or emails. I either get the message you are already registered, but than still no in-coming mail or it will let me resign up and no mail. This has happened with a couple other places I've done business with too, but right now can't remember which other ones. Can you help with this problem too? Thank you.

    This issue can be caused by corrupted cookies or cookies that are blocked.
    *check the permissions on the about:permissions page and in "Tools > Page Info > Permissions"
    Clear the cache and remove cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Users unable to get email notifications on followed sites, or documents: System.IO.FileNotFoundException and Microsoft.SharePoint.SPSite.InitUserToken(SPRequest request) errors

    Hi Community
    I have an issue on a live SP2013 farm that is really causing me grief.  Although  I ( Farm Admin)  and my other users can follow items which are subsequently  confirmed in our respective News Feeds - 
    none of my users are are actually getting emails notifications . 
    Alerts ( did) work fine.
    I have written some PS to vew and set  the SPS-EmailOptin for each user
    $up[$upManagerAttribute].Value = $managerNTName
    # check if the email check boxes are unchecked '1' then if so check all
    write-host -fore white "User Profile for user"$NTName "Now has email opt in currently set to" $up[$upEmailOptin].Value
    if ($up[$upEmailOptin].Value -gt 0)
    $up[$upEmailOptin].Value = 0
    write-host -fore white "User Profile for user"$NTName "Now has email opt in all checked."
    Very few are unchecked. $up["SPS-PrivacyActivity"].Value = 4095  is set for all users as in
    the the privacy settings on the newsfeed are all checked
    For my currrent client I  set up a development intranet which had the seperate web apps for the main portal and mysites. Test users were able to follow documents, sites without any problems.  Before go live I was asked to accomodate a requirement
    where there is only one web application (don't ask!)  effectivley http://myintranet 
    so mysites sits under http://myintranet/mysites .   I  made the appropriate changes to my AutoSPInstaller scritpt and al appearedd l good : services , Service appplications, mysites are all started.  I am using
    the two app pool accounts  one for the portal and one for mysites.
    A quick look at the the releated threads on this forum indicated permssions could be DB permissions  related tho I  am not seeing anything in ULS to strongly point to this
    $webApp = Get-SPWebApplication http://myintranet
    $webApp.GrantAccessToProcessIdentity("mydomain\SP_ProfilesAppPool")
    - checked and SPAcess Data is given to the mysites app pool accout to the portal web app .
    I am seeing some odd errors in ULS
    Ignoring the space ' critical' warning which I have flagged up to Ops and  I doubt is my real problem.  The errors I see that are related are :
    System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002), StackTrace:
    at Microsoft.SharePoint.SPWeb.GetList(String strUrl)
    at Microsoft.Office.Server.Microfeed.MBUtilities.GetPublishedFeedListPrivate(SPWeb web, String relativeUrl)
    at Microsoft.Office.Server.UserProfiles.FollowedItem.CreateFollowedSite(SPWeb site, FollowedItemData data)
    at Microsoft.Office.Server.UserProfiles.FollowedItem.Create(SPSite site, SPWeb existingWeb, Uri url, FollowedItemData data)
    at Microsoft.Office.Server.UserProfiles.FollowedItem.RecreateByReferencedItem(SPSite site, SPWeb web)
    at Microsoft.Office.Server.UserProfiles.FollowedContent.RefreshFollowedItem(FollowedItem item, SPS2SAppExecutionPolicy policy)
    at Microsoft.Office.Server.UserProfiles.FollowedContent.Follow(Uri url, FollowedItemData data)
    at Microsoft.Office.Server.UserProfiles.FollowedContentServerStub.InvokeMethod(Object target, String methodName, XmlNodeList xmlargs, ProxyContext proxyContext, Boolean& isVoid)
    at Microsoft.SharePoint.Client.ServerStub.InvokeMethodWithMonitoredScope(Object target, String methodName, XmlNodeList args, ProxyContext proxyContext, Boolean& isVoid)
    at Microsoft.SharePoint.Client.ClientMethodsProcessor.InvokeMethod(Object obj, String methodName, XmlNodeList xmlargs, Boolean& isVoid)
    at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessMethod(XmlElement xe)
    and
    5b93b0ef-b1ff-437d-b674-5285be9b9395 Stack trace:
    at Microsoft.SharePoint.SPSite.InitUserToken(SPRequest request)
    at Microsoft.SharePoint.SPSite.SPSiteConstructor(SPFarm farm, Guid applicationId, Guid contentDatabaseId, Guid siteId, Guid siteSubscriptionId, SPUrlZone zone, Uri requestUri, String serverRelativeUrl, Boolean hostHeaderIsSiteName, SPUserToken userToken, Boolean appWebRequest, String appHostHeaderRedirectDomain, String appSiteDomainPrefix, String subscriptionName, String appSiteDomainId, Uri primaryUri)
    at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, Boolean swapSchemeForPathBasedSites, SPUserToken userToken)
    at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken)
    at Microsoft.SharePoint.SPSite..ctor(String requestUrl)
    at Microsoft.Office.Server.UserProfiles.SPS2SAppUtility.TryOpenWeb(Uri url, SPSite& site, SPWeb& web, Boolean& inSPContext)
    at Microsoft.Office.Server.UserProfiles.SPS2SAppExecutionContext.InitializeForSite()
    at Microsoft.Office.Server.UserProfiles.SPS2SAppExecutionContext.EnsureInitialized()
    Also, I am testing with my account which does have all the mysites newsfeed options checked in the CA -> UPA ->"Manage User Profile"
    Anybody seen this whilist I follow the where those exceptions take me.
    Freelance consultant

    Hi,
    Thank you for your question. I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience. Thank you for your understanding and support.
    Thanks,
    Linda Li
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • How do I stop getting email notifications from Apple. I have checked all of the "no" boxes. Help!

    How do I stop getting email notifications from Apple support. I have checked all the "no" boxes. Help!

    https://discussions.apple.com/docs/DOC-3661
    Message was edited by: deggie

Maybe you are looking for