Set the sender name of message

Hi all,
I have given my company mail address as the sender as following.
message.setFrom("[email protected]");
In yahoo mail and gmail, it displays "[email protected]" as the sender of the message. I want to display the name of sender rather than email address. Is there anyway to do this programatically?
Thanks and regards

i also has same request, it try this but it has some problem. Can anybody explain to me?
public static void main(String args[]) throws IOException, SQLException, MessagingException
        String host = "mail.company.com";
     String from = "[email protected]";
     String to = "[email protected]";
     // Get system properties
     Properties props = System.getProperties();
     // Setup mail server
     props.put("mail.smtp.host", host);
     // Get session
     Session session = Session.getDefaultInstance(props, null);
     // Define message
     MimeMessage message = new MimeMessage(session);
     message.setFrom("haha<[email protected]>");
     message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
     message.setSubject("Human Resource Department");
     message.setText("Welcome to JavaMail");
     // Send message
     Transport.send(message);
   }Error message:
sendMail.java.28: cannot find symbol
symbol: method setFrom(java.lang.String)
location: class javax.mail.internet.MimeMessage
message.setFrom("haha<[email protected]>");
^

Similar Messages

  • Setting the display name in a message

    Hello for the following code:
    String from = "[email protected]";
    Message msg = new MimeMessage(session);
    msg.setFrom(new InternetAddress(from));
    I'd like to set the display name, i.e.
    "A Message From Foo"
    However I did not see a msg.setDisplayName() method... is there any way to do this?
    As a working example, amazon sends an email with a return address of [email protected], but the display name is 'Amazon Payments' which looks a lot nicer for the customer. I'd like to do the same.
    Thanks

    Solution is:
    new InternetAddress(email_address, display_name);

  • Setting the sender of a send request (cl_bcs) with method set_sender?

    Hello,
    When I set the sender of a send request before sending to an object created with
    cl_sapuser_bcs=>create( lv_username ).
    the message is displayed with myself as the 'author' in the inbox of the business workplace (SO01).
    Did I miss something? (Or is this a feature that can be influenced differently...)
    - When I display the recipients list of this message, for each of the recipients the sender that was set explicitely is shown correctly.
    - The smtp-recipient sees the correct sender information,
    - The RML-recipient (in a different R/3 system) sees the correct sender information as well.
    Can you please give me a hint on what to do, so that the intended sender of the message is shown to all recipients, not only the remote ones?
    Thanks & Best Regards,
    Robert.

    Hi Rainer,
    I do almost the same thing, only that I do not want sy-uname (i.e. myself) to appear as the sender of the message.
    Could you try to check if the following works for you:
      lv_uname = 'DAGOBERT'.  " (user name of a user other than sy-uname)
      sender = cl_sapuser_bcs=>create( lv_uname ).
      request->set_sender( exporting i_sender = sender ).
    Who is shown as the author of the message in the inbox: sy-uname or 'DAGOBERT'?
    Thanks & Regards,
    Robert.
    Edited by: Robert Voppmann on Sep 21, 2009 1:53 PM

  • Send apple email - how do I set the - send FROM account?

    found this nice script to auto create and send apple email...
    Q: how do I set the : send from account?
    tell application "Mail"
    set theMessage to make new outgoing message with properties {visible:true, subject:"My Subject", content:"My Body"}
    tell theMessage
    make new to recipient at end of to recipients with properties {name:"test", address:"[email protected]"}
    end tell
    send theMessage
    end tell
    nice info here:
    http://www.mactech.com/articles/mactech/Vol.21/21.09/ScriptingMail/index.html

    I've been using the following which may be more complicated than necessary but it does work:
    -- SCRIPT SEGMENT --
    tell application "Mail"
    activate
    set listOfSenders to {}
    set everyAccount to every account
    repeat with eachAccount in everyAccount
    set everyEmailAddress to email addresses of eachAccount
    if (everyEmailAddress is not equal to missing value) then
    repeat with eachEmailAddress in everyEmailAddress
    set listOfSenders to listOfSenders & {(full name of eachAccount & " <"Mail"
    set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return}
    tell newMessage
    set visible to true
    set sender to theSender
    make new to recipient at end of to recipients with properties {name:theName, address:theAddress}
    set font to "Lucinda Sans"
    set size to 14
    end tell
    activate
    --send newMessage
    end tell
    -- END SCRIPT SEGMENT --
    I have commented the actual "send message" line so that I can read the message before clicking the send button as I often will add a comment.
    Al

  • OracleConnectionCacheImpl - "Setting the user name and passwwdd"

    Does anyone know how to disable (or suppress, or redirect) the message...
    "Setting the user name and passwwdd"
    ... when using OracleConnectionCacheImpl?
    null

    This is bug 1317673
    null

  • Setting the role name dynamically

    Hi,
    I have defined 4 roles in the application. In the workflow navigation, i have created a notification. How can i set the role name property of the Notification message dynamically so that as soon as the control comes to that notification, all the users in that role gets the notification message?
    Thank you.

    Hello,
    Define a attribute which holds the value of one of the four defined roles.Then create some activity (with some defined function) which will select the role and assign to the attribute.
    In the notification give the performer value as attribute name.
    This will solve your purpose.
    Kind Regards,
    Kumar.

  • The mail server responded: sorry, the sender name and auth login doesn't coincide (#5.7.1)

    I get the following message on trying to send emails from my yahoo account
    An error occurred while sending mail. The mail server responded: sorry, the sender name and auth login doesn't coincide (#5.7.1). Please verify that your email address is correct in your Mail preferences and try again.
    Help!

    Check if the client connector used to connect with the 587 port is allowed to accept authentication on Plain Text.
    Try a relay connector if you want to send the email without the authentication.
    http://technet.microsoft.com/en-us/library/bb232021(v=exchg.141).aspx
    Syed MM Messaging SME - IBM || MCTS || MCSE || MCSA || VCP5 || VCA ||

  • Where is the "Send as Text Message" option?

    This article: http://www.pcmag.com/article2/0,2817,2425311,00.asp indicates that clicking and holding on a sent iMessage in iOS 7 pops up a menu with the following three options: 'Copy', 'Send as Text Message' and 'More...'. On my iPhone 5 (iOS 7.0.4) I don't get the 'Send as Text Message' option. Why? Thanks.

    Thanks. I tried to do this but the message goes out on iMessage instantaneously. No time to hold on it and select the 'Send as Text Message' option.
    My problem is I am trying to send a message to someone's iPhone without a data plan. So, when the person is away and not connected to Wi-Fi, he or she will not receive my messages that go out on iMessage (and likely land on the person's other Apple devices at home). Combining iMessage with SMS seems like an error on Apple's side. Is there a workaround?

  • Set the column name of a table in a list box

    is there any code to set the column name of a table in a list box at oracle devloper 6i?
    pls help.

    I dont want to go for pl/sql . It should work any table.You want Dynamic SQL without using PL/SQL? Tricky. I'm sure there's a possible way using some very complex and convoluted XML functionality of SQL but in reality you are asking for something that isn't natural to SQL queries, especially if you are expecting a dynamic number of columns to be produced for each row of data. SQL expects a table structure, including output formats, to be a defined number of columns with any number of rows, not a defined number of rows with any number of columns.
    Perhaps if you explain why you need this sort of functionality then we may be able to offer a better solution.
    ;)

  • Export Indd to EPS/JPG and set the file name  for EPS/JPG file

    Hi,
       When I export the INDD to JPG/EPS, I want to set the file name with pageNumber  for JPG/EPS files using javascript.
    For Example
    If I set the file name as EPSFile.eps, after exporting the indd(with 2 pages) to eps
    ,files are generating in the following name EPSFile_1.eps, EPSFile_2.eps.
    but I want to set the file name as EPSFile_001.eps and EPSFile_002.eps using javascript.
    anyone knows please reply for this.
    Regards,
    Mubeen

    Hi,
      I tried the following code.
    var JPGe = new File("Applications/PDF/JPG/file.jp");
    app.activeDocument.exportFile(ExportFormat.jpg, );
    when I use this code ,exported jpg file names are
    file.jpg, file1.jpg,file3.jpg.
    but ,I want the output file names as file_001,file_002,file_003,
    Thanks,
    Mubeen

  • Changing the sender name of WF-BATCH

    Hi,
    I am new to workflow programming and looking for guidance on changing the sender name of the emails going (SENDMAIL activity) as WF-BATCH user.
    I looked at the input from this group on similar question and understood that what I need to achieve can only be done via FM SO_DOCUMENT_SEND_API1.
    I am unsure how to accomplish this if the email I am sending out needs to read the description captured in the task (whic is a dialog method) before this (TS01000140).
    Can anyone give me inputs on how to achieve this?
    Thanks for commenting.
    María

    Hi,
    First of all, you might want to check class cl_bcs for sending emails. Basically your function will do the same but this class is a bit more functionality. Plenty of examples in SCN/Internet.
    Whatever function/method you will choose to use, the idea is to develop a workflow method, and then call the email sending function/method from this method. Then you of course develop a task that will call your new method. Now, you will need certain parameters for the email sending function/method: subject, body text, recipient, etc. You need to either deliver these parameters for the method from your workflow container or build some additional logic to the workflow method. E.g. if your task TS01000140 gets the email text into the workflow container, then you need to bind it to your email sending task (and to the method) => you need to add this to your task container and then add it as a parameter to your method.
    One additional hint: When building the custom logic, pay attention to email language. You want to deliver the emails in correct language, so the recipient language must be known before the email is sent...
    Regards,
    Karri 

  • How to change the sender name "workflow system" to Diff name

    Hi ,,
      How to change the mail sender name that is "workflow system" to different name. Whenever the mail is triggered it shows the sender name as "workflow system" . i want to change the name of the sender..Even i changed the name of the WF-Batch(name) user but no use.. Pls advice.
    regards,
    Roops.

    Hi Roops,
    Check if the following [link1|Re: How to change text of wf batch??] [link2|Update should not happen in the name of WF-BATCH] helps you.
    Regards,
    Saumya

  • My inbox used to show the sender for each message and now it does not...how do I get it back to where it was?

    My inbox used to show the sender for each message and now it does not...how do I get it back to where it was?

    Right click the heading at the top of the message list and select From from the list of options.

  • Want to suppress "Setting the user name and passwwdd"

    Does anyone know how to suppress the
    "Setting the user name and passwwdd login password" line that comes out on stdout
    when using OracleConnectionCacheImpl and
    the thin driver?
    Thanks,
    Chesla

    This is bug 1317673
    null

  • Setting the id names in a datatable

    is there a way to control the names of the id fields of individual elements in a datatable?
    I need to call a website I have no control over. This website is expecting variable to be in the http request using 'POST'. The variables names are VARCNT0,VARCNT1,....,VARCNTn -VARFLE0,VARFLE1,.....,VARFLEn. where n is variable depending on a previous choice.
    Is there a way to force Java Studio or JSF to set the variable names as such instead of form1:dataTable1 :1:VARCNT, form1:dataTable1 :2:VARCNT, .... ,form1:dataTable1 :n:VARCNT
    Thanks,
    Kevin

    Giri,
    I need to call a url that is outside my server. This url expects the input to be a part of the post request. I want to capture the data that I post to this site in my database. I will show the response in an iframe within my site. The input variables for the site I am calling need to be VARCNT0 ... VARCNTN , VARFLE0...VARFLEN and VARTTL0...VARTTLN. Can this be done or am I going to have to add some sort of filter ? How can I after processing the event pass the post request to a url outside of my website. Does this make sense?
    Kevin

Maybe you are looking for

  • Changing how attachments are attached to outgoing email?

    Hello everyone, my apologies in advance if this has already been answered somewhere, but I've been scouring the discussion forums for nearly an hour and don't really have more time to keep going. I'm new to Mac, 6 days now. I'm having a bit of a prob

  • Accessing ServletContext in a Action file

    Hi all, I have a servlet which i load on start up and put in the context. Now, i want to retrieve that servlet from the context and use it in a Action file, what should i do? The class Action, which every action file extends doesn't have any method t

  • Lumpsum discount for ED subtotal before VAT in MIRO

    Dear all, How to give lumpsum discount after Excise duties subtotal,based on that total VAT is calculated in vendor bill booking ? Expecting ur valuable replies. Jeyakanthan Edited by: Jeyakanthan A on Jan 12, 2010 10:26 AM

  • Apple care protection

    hello. i'm going to buy apple care protection for macbook pro online but im a bit confused about these 2 products. what is the difference between applecare protection plan for macbook pro http://store.apple.com/my-k12/product/MD013FE/A/applecare-prot

  • CAn't sync album art to iPhone 3GS ver3.0, why?!?!

    I tried to sync songs which have album art to the iPhone 3.0 by using iTunes 9, but some can, while some can't. Anyone would like to tell me the reason? All album art I downloaded from google. Picture type are JPEG. Is it because of the resolution or