Need help with mail sending mails..

Can anybody help me with a code that works perfectly for sending mails.. since i used many codes which are not working, so please help me with the code to send mails please or else with an example.

Hi kirupa_sankar,
To send mails to others you have to use javax.mail.jar file and sample code is
import javax.mail.*;
import javax.mail.internet.*; // important
import javax.mail.event.*; // important
import java.net.*;
import java.util.*;
public class Mail {
Properties props;
Session session1;
Message message;
boolean flag=false;
public boolean sendMail()
props=new Properties();
props.put("mail.smtp.host","mail.website.com"); // 'localhost' for testing
session1 = Session.getDefaultInstance(props,null);
String from= "[email protected]" ;
String subject = "testing mail(subjective matter)";
message =new MimeMessage(session1);
message.setFrom(new InternetAddress(from));
message.setRecipients(Message.RecipientType.TO,InternetAddress.parse("toaddress",false));
message.setSubject(subject);
message.setContent("content of the message");
Transport.send(message);
return true;
try this one you will get success....

Similar Messages

  • I need help with apex send mail

    I have created a apex send email, I tried to make it work I need help
    DECLARE
    v_Message VARCHAR2(4000);
    v_MsgHTML VARCHAR2(4000);
    v_CRLF VARCHAR2(6) := CHR(13) || CHR(10);
    begin
    v_Message := 'Your request has been sent to the Help Desk team:' ||
    v_CRLF || v_CRLF;
    v_Message := v_Message || 'YOUR_NAME: ' || :P10_YOUR_NAME || v_CRLF;
    v_Message := v_Message || 'COMPANY_Name: ' || :P10_COMAPNY_NAME || v_CRLF;
    v_Message := v_Message || 'ADDRESS: ' || :P10_ADDRESS || v_CRLF;
    v_Message := v_Message || 'CITY: ' || :P10_CITY || v_CRLF || v_CRLF;
    v_Message := v_Message || 'STATE: ' || :P10_STATE || v_CRLF;
    v_Message := v_Message || 'ZIP: ' || :P10_ZIP || v_CRLF;
    v_Message := v_Message || 'DAYTIME_PHONE: ' || :P10_DAYTIME_PHONE || v_CRLF;
    v_Message := v_Message || 'EVENTING_PHONE: ' || :P10_EVENTING_PHONE || v_CRLF || v_CRLF
    v_Message := v_Message || 'MOBILE_PHONE: ' || :P10_MOBILE_PHONE || v_CRLF;
    v_Message := v_Message || 'FAX: ' || :P10_FAX || v_CRLF;
    v_Message := v_Message || 'EMAIL_ADDRESS: ' || :P10_EMAIL_ADDRESS || v_CRLF;
    v_Message := v_Message || 'OCCASION: ' || :P10_OCCASION || v_CRLF || v_CRLF
    v_Message := v_Message || 'TYPE_OF_PARTY: ' || :P10_TYPE_OF_PARTY || v_CRLF;
    v_Message := v_Message || 'DATE_OF_EVENT: ' || :P10_DATE_OF_EVENT || v_CRLF;
    v_Message := v_Message || 'TIME_OF_EVENT: ' || :P10_TIME_OF_EVENT || v_CRLF;
    v_Message := v_Message || 'LOCATION_OF EVENT: ' || :P10_LOCATION_OF EVENT || v_CRLF || v_CRLF
    v_Message := v_Message || 'ESTIMATED_GUEST_COUNT: ' || :P10_ESTIMATED_GUEST_COUNT || v_CRLF;
    v_CRLF := '
    v_MsgHTML := 'Your request has been sent to the Help Desk team:' ||
    v_CRLF || v_CRLF;
    v_MsgHTML := v_MsgHTML || 'YOUR_NAME: ' || :P10_YOUR_NAME || v_CRLF;
    v_MsgHTML := v_MsgHTML || 'COMPANY_Name: ' || :P10_COMAPNY_NAME || v_CRLF;
    v_MsgHTML := v_MsgHTML || 'ADDRESS: ' || :P10_ADDRESS || v_CRLF;
    v_MsgHTML := v_MsgHTML || 'CITY: ' || :P10_CITY || v_CRLF || v_CRLF;
    v_MsgHTML := v_MsgHTML || 'STATE: ' || :P10_STATE || v_CRLF;
    v_MsgHTML := v_MsgHTML || 'ZIP: ' || :P10_ZIP || v_CRLF;
    v_MsgHTML := v_MsgHTML || 'DAYTIME_PHONE: ' || :P10_DAYTIME_PHONE || v_CRLF;
    v_MsgHTML := v_MsgHTML || 'EVENTING_PHONE: ' || :P10_EVENTING_PHONE || v_CRLF || v_CRLF
    v_MsgHTML := v_MsgHTML || 'MOBILE_PHONE: ' || :P10_MOBILE_PHONE || v_CRLF;
    v_MsgHTML := v_MsgHTML || 'FAX: ' || :P10_FAX || v_CRLF;
    v_MsgHTML := v_MsgHTML || 'EMAIL_ADDRESS: ' || :P10_EMAIL_ADDRESS || v_CRLF;
    v_MsgHTML := v_MsgHTML || 'OCCASION: ' || :P10_OCCASION || v_CRLF || v_CRLF
    v_MsgHTML := v_MsgHTML || 'TYPE_OF_PARTY: ' || :P10_TYPE_OF_PARTY || v_CRLF;
    v_MsgHTML := v_MsgHTML || 'DATE_OF_EVENT: ' || :P10_DATE_OF_EVENT || v_CRLF;
    v_MsgHTML := v_MsgHTML || 'TIME_OF_EVENT: ' || :P10_TIME_OF_EVENT || v_CRLF;
    v_MsgHTML := v_MsgHTML || 'LOCATION_OF EVENT: ' || :P10_LOCATION_OF EVENT || v_CRLF || v_CRLF
    v_MsgHTML := v_MsgHTML || 'ESTIMATED_GUEST_COUNT: ' || :P10_ESTIMATED_GUEST_COUNT || v_CRLF;
    HTMLDB_MAIL.SEND(
    P_TO => '[email protected]',
    P_FROM => :P16_EMAIL,
    P_BODY => v_message,
    P_BODY_HTML => v_MsgHTML,
    P_SUBJ => :P16_CHURCH_NAME || ' Help Request');
    APEX_MAIL.PUSH_QUEUE;
    end;
    YOUR_NAME,
    COMPANY_NAME,
    ADDRESS,
    CITY,
    STATE,
    ZIP,
    DAYTIME_PHONE,
    EVENTTIME_PHONE,
    MOBILE_PHONE,
    FAX,
    EMAIL_ADDRESS,
    OCCASION,
    TYPE_OF_PARTY,
    DATE_OF_EVENT,
    TIME_OF_EVENT,
    LOCATION_OF EVENT,
    ESTIMATED_GUEST_COUNT

    DECLARE
    v_message VARCHAR2 (4000); v_msghtml VARCHAR2 (4000); v_crlf VARCHAR2 (6) := CHR (13) || CHR (10);BEGIN v_message := 'Your request has been sent to the Help Desk team:' || v_crlf
    || v_crlf; v_message := v_message
    || 'YOUR_NAME: ' || :p10_your_name
    || v_crlf; v_message := v_message
    || 'COMPANY_Name: ' || :p10_comapny_name
    || v_crlf; v_message := v_message
    || 'ADDRESS: ' || :p10_address
    || v_crlf; v_message := v_message
    || 'CITY: ' || :p10_city
    || v_crlf
    || v_crlf; v_message := v_message
    || 'STATE: ' || :p10_state
    || v_crlf; v_message := v_message
    || 'ZIP: ' || :p10_zip
    || v_crlf; v_message := v_message
    || 'DAYTIME_PHONE: ' || :p10_daytime_phone
    || v_crlf; v_message := v_message
    || 'EVENTING_PHONE: ' || :p10_eventing_phone
    || v_crlf
    || v_crlf; v_message := v_message
    || 'MOBILE_PHONE: ' || :p10_mobile_phone
    || v_crlf; v_message := v_message
    || 'FAX: ' || :p10_fax
    || v_crlf; v_message := v_message
    || 'EMAIL_ADDRESS: ' || :p10_email_address
    || v_crlf; v_message := v_message
    || 'OCCASION: ' || :p10_occasion
    || v_crlf
    || v_crlf; v_message := v_message
    || 'TYPE_OF_PARTY: ' || :p10_type_of_party
    || v_crlf; v_message := v_message
    || 'DATE_OF_EVENT: ' || :p10_date_of_event
    || v_crlf; v_message := v_message
    || 'TIME_OF_EVENT: ' || :p10_time_of_event
    || v_crlf; v_message := v_message
    || 'LOCATION_OF EVENT: ' || :p10_location_of_event
    || v_crlf
    || v_crlf; v_message := v_message
    || 'ESTIMATED_GUEST_COUNT: ' || :p10_estimated_guest_count
    || v_crlf;
    v_crlf := '
    '; v_msghtml := 'Your request has been sent to the Help Desk team:' || v_crlf
    || v_crlf; v_msghtml := v_msghtml
    || 'YOUR_NAME: ' || :p10_your_name
    || v_crlf; v_msghtml := v_msghtml
    || 'COMPANY_Name: ' || :p10_comapny_name
    || v_crlf; v_msghtml := v_msghtml
    || 'ADDRESS: ' || :p10_address
    || v_crlf; v_msghtml := v_msghtml
    || 'CITY: ' || :p10_city
    || v_crlf
    || v_crlf; v_msghtml := v_msghtml
    || 'STATE: ' || :p10_state
    || v_crlf; v_msghtml := v_msghtml
    || 'ZIP: ' || :p10_zip
    || v_crlf; v_msghtml := v_msghtml
    || 'DAYTIME_PHONE: ' || :p10_daytime_phone
    || v_crlf; v_msghtml := v_msghtml
    || 'EVENTING_PHONE: ' || :p10_eventing_phone
    || v_crlf
    || v_crlf; v_msghtml := v_msghtml
    || 'MOBILE_PHONE: ' || :p10_mobile_phone
    || v_crlf; v_msghtml := v_msghtml
    || 'FAX: ' || :p10_fax
    || v_crlf; v_msghtml := v_msghtml
    || 'EMAIL_ADDRESS: ' || :p10_email_address
    || v_crlf; v_msghtml := v_msghtml
    || 'OCCASION: ' || :p10_occasion
    || v_crlf
    || v_crlf; v_msghtml := v_msghtml
    || 'TYPE_OF_PARTY: ' || :p10_type_of_party
    || v_crlf; v_msghtml := v_msghtml
    || 'DATE_OF_EVENT: ' || :p10_date_of_event
    || v_crlf; v_msghtml := v_msghtml
    || 'TIME_OF_EVENT: ' || :p10_time_of_event
    || v_crlf; v_msghtml := v_msghtml
    || 'LOCATION_OF EVENT: ' || :p10_location_of_event
    || v_crlf
    || v_crlf; v_msghtml := v_msghtml
    || 'ESTIMATED_GUEST_COUNT: ' || :p10_estimated_guest_count
    || v_crlf;
    HTMLDB_MAIL.SEND(
    P_TO => '[email protected]',
    P_FROM => '[email protected]',
    P_BODY => v_message,
    P_BODY_HTML => v_message,
    P_SUBJ => 'Application Comments!!');
    APEX_MAIL.PUSH_QUEUE;
    end;

  • Need help with Rules for mail accounts

    Today I deleted a rule for a mail account and now I cant receive mail in 4 of 8 accounts. I'm not experienced with Mac's Mail program. Id there something you have to do for multiple accounts to recieve all mail? I can send but not receive.
    Help!
    ~ Tammy

    It's hard to believe that deleting a rule could have a bearing on the ability to receive messages from any account... unless that rule did something that prevented subsequent rules to process the messages that you apparently can't receive now.
    That is, either having deleted the rule has absolutely no bearing on your problem, or the problem is that those messages are now being processed in an unexpected way by some of your other rules.
    What type of accounts are these (POP, IMAP, .Mac)? What does "I cant receive mail in 4 of 8 accounts" mean?

  • Need help, can't send mail from webmail but can from clients

    Just got Lion Server up and running but i'm having a problem sending mail via the webmail (Roundcube). I keep getting this error
    SMTP error (250): Authentication failed.
    The problem is that no one needs to be authorized to send mail. All my clients work fine sending from their mail client software. It seems that roundcube wants to autheticate in some form and doesn't know it doesn't need to. But where do I change that setting??

    i noticed this in my logs, so I'm sure roundcube is trying to access the server using authentication, but I don't know how to change it.
    [29-Dec-2011 14:27:42] SMTP server does not support authentication ():
    [29-Dec-2011 14:27:42 -0800]: SMTP Error: SMTP error: Authentication failure: SMTP server does not support authentication (Code: ) in /usr/share/webmail/program/steps/mail/func.inc on line 1502 (POST /webmail/?_unlock=loading1325197839437?_task=mail&_action=send)
    I went to the line 1502 but it doesn't look like I should change anything there.

  • Need help with Bellsouth e-mail for touch

    Downloaded the new upgrade and love the e-mail function except that I cannot send a message via my Bellsouth account. Yes, I synched the e-mail and I also can receive the messages, just not send. Also, my Yahoo account can both send and receive with no problems. I have checked my settings (and rechecked them) many times and everything appears correct. The message I receive is that -The connection to the outgoing server "mail.bellsouth.net"failed-.
    Any ideas??

    Hey laura116688,
    Generally ISP's will only let you send emails when you are connecting to the Internet with their Internet connection. So, if you use the outgoing mail server "mail.bellsouth.net" you will probably only be able to send when you are connected to your home Wi-Fi network.
    Try the tips in this article:
    http://docs.info.apple.com/article.html?artnum=305634
    Make sure you try the tips listed under "Configure iPhone Mail for EDGE" that have you change the outgoing mail server to cwmx.com which works on the EDGE network.
    Jason

  • I need help with my mac mail account password!

    okay. so i came home one day after work, and i went to check my mail. there is a squiggly line next to my inbox. i tried to send a message, and a box popped up asking for my account password. now i only use two passwords - one is a word with numbers, and the other is just a word. i entered both, and was told they were incorrect. i'm stumped. am i going to have to start a new account? is there a way to change the password and still get my mail? would someone please help me out? thanks in advance to anyone who does.

    Well, then maybe Mail is corrupted, so let's try to fix that. You'll need:
    1. your Mac OS X installation disc.
    2. a copy of Pacifist.
    3. confidence and patience.
    First, quit Mail, go to Users/your username/Library/ and copy the Mail folder to your Desktop; then download Pacifist using the link above.
    Next, insert your Mac OS X installation disc, open it with Pacifist and browse the contents of the Optional Installs folder until you find the installer package for Mail, then open that Mail package.
    Select the top-level of that package in the Pacifist file listing and click on the Extract button in Pacifist and choose your Desktop for the destination. When that is finished, move the newly extracted copy of Mail to your HD/Applications folder. Choose "Replace" when it tells you there's already a newer or older file there with the same name.
    Quit Pacifist, open System Preferences and use Disk Utility to Repair Permissions; then quit System Preferences, logout and log back in, then try starting Mail and see if that resolves your problem.
    Mulder

  • HELP I need help with Visual voice mail

    I need someone who has done it before to tell me how to use a prerecorded voice mail greeting.Or at-lest how to use one for my greeting on my VVM downloaded from the web in MP3 format.

    Hello,
    Please follow the steps outlined below to change your voicemail personal greeting. You will not be able to use an mp3 file as your greeting.
    With your device, dial *86 + send
    Enter your password
    Press 4 (personal options)
    Press 3 (record greetings)
    Press 1 (to change your personal greeting)
    Choose the type of greeting you want. Press 1 for your cell number to be announced, Press 2 for your name to be announced or Press 3 for a personal greeting 
    For more information on voicemail, please visit the link below:
    Voice Mail
    For information about Visual Voicemail, please visit:
    Visual Voicemail
    Thank you.
    KellyW@VZWSupport

  • Need help with new 3GS mail problems

    I have a new 3GS v.4.1 about a week now, just getting around to setting up the mail. I synced through Itunes, checked the setting's. I can send email but not recieve. Can anyone help?

    Any error message provided when the account is checked for new messages?
    Under the Info tab for your iPhone sync preferences with iTunes, deselect Sync Mail Accounts followed by selecting Apply. Follow this by deleting and manually recreating the account on your iPhone. If this is successful, do not reselect Sync Mail Accounts under the Info tab for your iPhone sync preferences or you will be right back where you started.

  • Need Help with google partnerpage mail.

    We have our domain setup with google partnerpages. When I sign in I sign in with my [email protected] - my company. It is a google account but it is not a gmail domain.
    I cannot get the iphone to retreive or send email from this account. I have tried both gmail and other mail accounts. gmail will not work because it will not allow you to delete the "gmail.com" part of the signon.
    Has anyone got this working? Can anyone?

    l1ghtm4n,
    Google lists pop3 servers to use on their site for your domain.
    With that information you can configure the account under the "Other" option for the POP3 protocol.
    Hope this helps,
    Nathan C.

  • Need help with Workflow notification mailer setup

    Hi all,
    I have the following requirement from my client:
    "IT has a project request from the Accounting Department to automate payments for Canadian vendors. One of the things that will need to happen on this project is setting up the Workflow Notification Mailer in AP so emails can be sent to vendors notifying them of payment. We only want to support Canadian vendors – payment processing for US vendors will continue to be handled as it is today."
    Please let me know how this can be done as I have no knowledge of setting up workflow notification mailer for a particular item.
    Thanks.

    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=231286.1
    Lot more information in Oracle Applications System Admin guide. To process messages from only a given itemtype you will use Correlation ID parameter of the mailer. But there are lot of other things that you should consider for such a set up. You would be having a build up of messages in WF_NOTIFICATION_OUT queue that you may want to manually take care of cleaning up.
    More reading at https://metalink.oracle.com/metalink/plsql/f?p=130:14:6827350883078622813::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,453137.1,1,1,1,helvetica

  • Need help with Mountain Lion Mail

    Having trouble with the mail app in Mountain lion. I want it to work like on my iPhone and iPad with Push mail and notifications, but i cant figure out how to get this to work. I have an iCloud account and a Gmail account. THanks for any advice

    Post here then:
    https://discussions.apple.com/community/mac_os/os_x_mountain_lion#/?tagSet=1466

  • Seriously need help with setting up mail on macbook pro

    Please,
    someone advise me on how to put my gmail and my workmail accounts into one mail application and organize it. I have been trying to figure it out all day and my head is about to explode. Somehow i managed to pull all the emails from both accounts into the application but it is all a huge mess and is not working as it should.

    If your using POP, take a look at this link:
    http://mail.google.com/support/bin/answer.py?hl=en&answer=13275
    If your using IMAP, take a look at this link:
    http://mail.google.com/support/bin/answer.py?hl=en&answer=81379

  • I need help with Yahoo web mail issues - icons are missing.

    I need the link to install eWebMail Color and Graphics extension since all the icon in yahoo email for forward,delete, close...etc are disappeared.
    Can anybody help me in that.
    THANKS FOR ALL
    ''Title edited by a moderator''

    See:
    * http://kb.mozillazine.org/Website_colors_are_wrong
    * http://kb.mozillazine.org/Websites_look_wrong
    If images are missing then check that you aren't blocking images from some domains.
    See:
    * http://kb.mozillazine.org/Images_or_animations_do_not_load
    * Check the permissions for the domain in the current tab in Tools > Page Info > Permissions
    * Check that images are enabled: Tools > Options > Content: [X] Load images automatically
    * Check the exceptions in Tools > Options > Content: Load Images > Exceptions
    * Check the "Tools > Page Info > Media" tab for blocked images (scroll through all the images)
    There are also extensions (Tools > Add-ons > Extensions) that can block images.
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Need help with activating Voice Mail. I am new to Verizon moving from At

    HELP!

    Open the dialer app and tap on the icon on the bottom left that looks like a tape.  Follow prompts to set up voicemail

  • I desperately need help with Mail, specifically sending

    For Starters:  I am on OSX 10.9.2 and am trying to use mail 7.2.
    https://discussions.apple.com/post!input.jspa?container=2998&containerType=14&qu estion=I+desperately+need+help+with+Mail%2C+specifically+sending
    I cannot send.  I have been at this for hours and hours and hours.  Here are the details.
    my mail server however is s1.sistercompany.net
    I can receive email just fine.  I can also send mail just find having set this up on my iphone and also in thunderbird (which i hate hate hate hate hate hate hate, which is why I am desperate to set up mail)
    The settings in thunderbird are as follows:
    Servername: s1.sistercompany.net
    port: 465
    Authentication method:  normal password
    Connection Security:  SSL/TLS
    However, I just can't get this to work in Mail.  When I write an email and hit send I get a popup that says:
    Cannot send message using the server s1.sistercompany.net
    The certifcate for this server is invalid.
    Now, my tech guy says yeah the certifacte is invalid because you are going through sistercompany server, there should be some way to just accept the certifcate anyway (but he has never used mail before).
    So I have serached around and come up with this: http://support.apple.com/kb/PH11706
    Which tells me to use the verify certificate dialogue, which I would do except there is no verify certificate dialog.  Any thoughts?
    <Email Edited by Host>

    I don't have a problem watching the Lost episode on abc.com, using a stock MacBook with 512MB RAM. I don't know what technology abc.com uses in their viewer, but I have Flip4Mac and the latest version of Flash player installed.

  • Need help with iMac intel desktop - Mac mail consistently going OFFLINE

    I need help with Mac mail - it is frequently going "offline" and requesting me to "take all accounts online". My internet is working. It's been checked, checked and checked. Sometimes it just takes a reboot of the system and the modem to kick it in and make the little triangle symbol go away, but should I have to reboot daily? I have the Mac OS X Lion 10.7.5 installed. Is there a bug here or am I supposed to upgrade to Mavericks? Any help is most appreciated.

    For me this is an issue caused by my email service provider.  When they are slow to respond or to accept the password Mail takes that as a password rejection, and prompts me to reenter password, and eventually goes offline.

Maybe you are looking for

  • Product Category Hierarchy in SRM

    Hi, Is any one has experienced in Creating product category hierarchy in SRM7.0? Also how we can replicate the material group hierarchy from ECC to SRM7.0? Vasu

  • How to add a voiceover?

    I'm creating a picture book and I want to add a voiceover. I don't want to use an automatic iBooks voice that reads the text -- I want to use a voiceover artist, so I'll be adding a recording to the book. Each page will have its snippet of voiceover.

  • License Information for Adventure Builder Example Application

    Hello All, We wanted to use the example application Adventure Builder in one of our research projects as a case study. (Link to adventure builder: http://java.sun.com/developer/releases/adventure/). However, I am not very sure about the license they

  • Multitouch not working win8...

    I've got a HP Compaq L2105tm touchscreen monitor. Using Windows 7 I was able to use the multitouch class for AIR, and enable pinch-zoom and such. With Windows 8 now, I no longer can get pinch-zoom working - and Multitouch.supportsGestureEvents now re

  • Help with SAPSCRIPT logos

    Hello All:        How do you download logos to SAPACRIPT form? Is there is a transaction to download images from a source so that I can upload to sapscript form? Where are thess logos stored in SAP? Thanks in advance. Mithun