Java Mail Madness - Doesn't Work but shows no errors ?

What's up folks. I am trying to implement the java mail library. Unfortunately, I have a problem and I don't know how to track it down. Here is the code that I run in the Netbeans IDE.
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class SendApp {
public static void send(String smtpHost, int smtpPort,
String from, String to,
String subject, String content)
throws AddressException, MessagingException {
// Create a mail session
java.util.Properties props = new java.util.Properties();
props.put("mail.smtp.host", smtpHost);
props.put("mail.smtp.port", ""+smtpPort);
Session session = Session.getDefaultInstance(props, null);
// Construct the message
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
msg.setRecipient(Message.RecipientType.TO, new InternetAddress(to));
msg.setSubject(subject);
msg.setText(content);
// Send the message
Transport.send(msg);
public static void main(String[] args) throws Exception {
// Send a test message
send("kernel", 25, "jd@kernel", "[email protected]",
"re: dinner", "How about at 7?");
Where kernel is the domain name of my computer. However, when I check my email at [email protected] (fake address) I don't see anything and the program exits with success. I don't know if this is cause of a problem with my Netbeans, my code, or my postfix smtp system. Any help is greatly appreciated !
SIncerely,
Justin Dallas

Hi,
Did you checked the log for any errors
catch (Exception e) {
     System.out.println("Exception while sending mail" + e.getMessage());
     e.printStackTrace();
Or else add the following line in your exception handler and check whether their is any error or not.
wdComponentAPI.getMessageManager().reportException(e.getMessage());
Regards
Ayyapparaj

Similar Messages

  • I'm having problems with facebook notifications.  The sound doesn't work but shows up in banner.  Any suggestions?  I've tried everything but restoring.  Is it a phone problem or an app problem?

    I am having a problem with facebook notifications.  The sound doesn't work but appears as a banner.  I've tried everything but restoring the phone.  Is this a phone problem or an app problem?  Has anybody experienced this problem and were they able to correct it? 

    1) This is because of software version 1.1. See this
    thread for some options as to how to go back to 1.0,
    which will correct the problem...
    http://discussions.apple.com/thread.jspa?threadID=3754
    59&tstart=0
    2) This tends to happen after videos. Give the iPod a
    minute or two to readjust. It should now be more
    accurate.
    3) This?
    iPod shows a folder icon with exclamation
    point
    4) Restore the iPod
    5) Try these...
    iPod Only Shows An Apple Logo and Will Not Start
    Up
    iPod Only Shows An Apple Logo
    I think 3,4, and 5 are related. Try the options I
    posted for each one.
    btabz
    I just noticed that one of the restore methods you posted was to put it into Disk Mode First rather than just use the resstore straight off, I Have tried that and seems to have solved the problem, If it has thank you. previously I have only tried just restoring it skipping this extra step. Hope my iPod stays healthy, if it doesnt its a warrenty job me thinks any way thanks again

  • Mail service gradually stopped working, but shows as running

    A problem with the UPS caused our OS X Server based mail server to shut down uncleanly. WHen it was restarted SMTP and IMAP were running and mail could be sent out by SMTP but incoming mail was just getting put on thr queue rather than being putinto the releveant mailbox. Checking for mail over IMAP just kept reporting no new messages. No error or anything. Mailbox was just empty.
    In trying to fix it I tried rebooting, at which point SMTP has ceased to work at all as well. The hard disk seems to be clicking away madly even when the machine should be doing nothing.
    Any ideas what may have gone wrong?
    Thanks
    Andrew

    I would think incoming mail is not making it through the content filter, but would need more information.
    Please open terminal and post the following output:
    postconf -n
    grep smtpd /etc/postfix/master.cf
    ps U clamav
    tail -50 /var/log/mail.log

  • TS3899 I have an iphone5 and the reply, forward and writing a message from the mail app doesn't work. I can check my mail but can't reply to it. What's going on?

    I have an iphone5 and the reply, forward and writing a message from the mail app doesn't work. I can check my mail but can't reply to it. What's going on?

    Try a reset: hold down the home button along with the sleep/wake button until you see the apple, then let go. (No data loss)

  • Just bought iPad gen3 the silence switch on the side doesn't work, it shows the symbol on screen but doesn't silence the iPad?????

    Just bought iPad gen3 the silence switch on the side doesn't work, it shows the symbol on screen but doesn't silence the iPad?????

    The Side Switch is to mute your ringers, and most of the application's sound. To totally mute the sound, you must use the rocker to mute it.

  • Mail server doesn't work after upgrading from SL to ML

    My Mail server doesn't work after upgrading from SL to ML
    Mail client connects with the Mail Server wich seems to run but then they can't receive any email...
    the problem seems to be related with dovecot ... in my smtp log i get this:
    relay=dovecot, delay=324, delays=324/0.02/0/0.01, dsn=4.3.0, status=deferred (temporary failure. Command output: pipe: fatal: pipe_command: execvp /usr/libexec/dovecot/deliver: Permission denied
    I have to say that in the usr/libexec there wasn't the dovecot directory so I just tried to create one but with no luck
    Any Ideas?
    Cheers
    Carlo
    This is my postconf -n info:
    server:Data admin$ postconf -n
    biff = no
    command_directory = /usr/sbin
    config_directory = /Library/Server/Mail/Config/postfix
    content_filter = smtp-amavis:[127.0.0.1]:10024
    daemon_directory = /usr/libexec/postfix
    data_directory = /Library/Server/Mail/Data/mta
    debug_peer_level = 2
    debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin xxgdb $daemon_directory/$process_name $process_id & sleep 5
    dovecot_destination_recipient_limit = 1
    enable_server_options = yes
    header_checks = pcre:/etc/postfix/custom_header_checks
    html_directory = /usr/share/doc/postfix/html
    imap_submit_cred_file = /Library/Server/Mail/Config/postfix/submit.cred
    inet_interfaces = all
    inet_protocols = ipv4
    mail_owner = _postfix
    mailbox_size_limit = 0
    mailbox_transport =
    mailq_path = /usr/bin/mailq
    manpage_directory = /usr/share/man
    maps_rbl_domains =
    message_size_limit = 20971520
    mydestination = $myhostname, localhost.$mydomain, localhost
    mydomain = moremoremore.it
    mydomain_fallback = localhost
    myhostname = server.moremoremore.it
    mynetworks = 127.0.0.0/8,192.168.178.0/24
    newaliases_path = /usr/bin/newaliases
    queue_directory = /Library/Server/Mail/Data/spool
    readme_directory = /usr/share/doc/postfix
    recipient_delimiter = +
    relayhost = mail.mclink.it
    sample_directory = /usr/share/doc/postfix/examples
    sendmail_path = /usr/sbin/sendmail
    setgid_group = _postdrop
    smtp_sasl_auth_enable = no
    smtp_sasl_password_maps =
    smtpd_client_restrictions = permit_mynetworks permit_sasl_authenticated reject_rbl_client zen.spamhaus.org permit
    smtpd_enforce_tls = no
    smtpd_helo_required = yes
    smtpd_helo_restrictions = reject_invalid_helo_hostname reject_non_fqdn_helo_hostname
    smtpd_pw_server_security_options = cram-md5,gssapi
    smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination check_policy_service unix:private/policy permit
    smtpd_sasl_auth_enable = yes
    smtpd_tls_CAfile = /etc/certificates/server.moremoremore.it.A358901573EE7B9B4D489725407934780D24D5 36.chain.pem
    smtpd_tls_cert_file = /etc/certificates/server.moremoremore.it.A358901573EE7B9B4D489725407934780D24D5 36.cert.pem
    smtpd_tls_exclude_ciphers = SSLv2, aNULL, ADH, eNULL
    smtpd_tls_key_file = /etc/certificates/server.moremoremore.it.A358901573EE7B9B4D489725407934780D24D5 36.key.pem
    smtpd_use_pw_server = yes
    smtpd_use_tls = yes
    tls_random_source = dev:/dev/urandom
    unknown_local_recipient_reject_code = 550
    virtual_alias_maps =
    server:Data admin$

    if this could help:
    mail:setStateVersion = 1
    mail:readWriteSettingsVersion = 1
    mail:connectionCount = 11
    mail:servicePortsRestrictionInfo = _empty_array
    mail:protocolsArray:_array_index:0:status = "ON"
    mail:protocolsArray:_array_index:0:kind = "INCOMING"
    mail:protocolsArray:_array_index:0:protocol = "IMAP"
    mail:protocolsArray:_array_index:0:state = "RUNNING"
    mail:protocolsArray:_array_index:0:error = ""
    mail:protocolsArray:_array_index:1:status = "ON"
    mail:protocolsArray:_array_index:1:kind = "INCOMING"
    mail:protocolsArray:_array_index:1:protocol = "POP3"
    mail:protocolsArray:_array_index:1:state = "RUNNING"
    mail:protocolsArray:_array_index:1:error = ""
    mail:protocolsArray:_array_index:2:status = "ON"
    mail:protocolsArray:_array_index:2:kind = "INCOMING"
    mail:protocolsArray:_array_index:2:protocol = "SMTP"
    mail:protocolsArray:_array_index:2:state = "RUNNING"
    mail:protocolsArray:_array_index:2:error = ""
    mail:protocolsArray:_array_index:3:status = "ON"
    mail:protocolsArray:_array_index:3:kind = "OUTGOING"
    mail:protocolsArray:_array_index:3:protocol = "SMTP"
    mail:protocolsArray:_array_index:3:state = "RUNNING"
    mail:protocolsArray:_array_index:3:error = ""
    mail:protocolsArray:_array_index:4:status = "OFF"
    mail:protocolsArray:_array_index:4:kind = "INCOMING"
    mail:protocolsArray:_array_index:4:protocol = "Junk_mail_filter"
    mail:protocolsArray:_array_index:4:state = "STOPPED"
    mail:protocolsArray:_array_index:4:error = ""
    mail:protocolsArray:_array_index:5:status = "OFF"
    mail:protocolsArray:_array_index:5:kind = "INCOMING"
    mail:protocolsArray:_array_index:5:protocol = "Virus_scanner"
    mail:protocolsArray:_array_index:5:state = "STOPPED"
    mail:protocolsArray:_array_index:5:error = ""
    mail:startedTime = "2013-01-21 21:18:32 +0000"
    mail:logPaths:IMAP Log = "/Library/Logs/Mail/mailaccess.log"
    mail:logPaths:Server Log = "/Library/Logs/Mail/mailaccess.log"
    mail:logPaths:POP Log = "/Library/Logs/Mail/mailaccess.log"
    mail:logPaths:SMTP Log = "/var/log/mail.log"
    mail:logPaths:Migration Log = "/Library/Logs/MailMigration.log"
    mail:logPaths:Virus Log = "/Library/Logs/Mail/clamav.log"
    mail:logPaths:Amavisd Log = "/Library/Logs/Mail/amavis.log"
    mail:logPaths:Virus DB Log = "/Library/Logs/Mail/freshclam.log"
    mail:imapStartedTime = "2013-01-21 21:18:34 +0000"
    mail:servicePortsAreRestricted = "NO"
    mail:state = "RUNNING"
    mail:postfixStartedTime = "2013-01-21 21:18:32 +0000"

  • Mail app doesn't work

    Mail app doesn't work after Yosemite OSX upgrade. At first it didn't check email and now it doesn't boot. I tried many times, but nothing happens

    Ok after nearly going crazy I read something about someone having a problem with a program related to fonts not being installed. I started up font book and now my problem is miraculously resolved... This is good and bad. I don't know why having font book running would resolve my problem or know what font is causing the programs not to work. As far as I know I didn't disable any system fonts. And the problem doesn't happen when font book is running, which is confusing me.

  • I got problem with home button it doesn't work but the touch ID is working ( I have 5S)

    I have the new iPhone 5S.
    And the problem is the  home button it doesn't work but the touch ID is working.
    I don't think the button is broken.  

    Hey! I just read something about it on a post by iPhone 4S Stuck at boot showing [NAND] ? at the end of the second page..... It is a lot of work by it depends on you if you want to try.... at the end if not working as varjak paw quoted you may have to replace it...... but don't give up!!!!

  • I installed adobe digital editions but when I want to authorize a device (an e-reader) it doesn't work, I receive an error message that digital editions cannot connect with the activation server. what can I do?

    I installed adobe digital editions but when I want to authorize a device (an e-reader) it doesn't work, I receive an error message that digital editions cannot connect with the activation server. what can I do?

    Please quote the exact error message, word-for-word, verbatim.
    What is your operating system?
    What version of Lightroom?

  • I have a MacBook Pro bought in dec 2009. Currently has mountain lion osx installed. Worked like a dream until today. Randomly froze, so I restarted it. To find I got a grey screen. It wouldn't start. Also note my DVD drive doesn't work, but mountain lion

    I have a MacBook Pro bought in dec 2009. Currently has mountain lion osx installed. Worked like a dream until today. Randomly froze, so I restarted it. To find I got a grey screen. It wouldn't start. Also note my DVD drive doesn't work, but mountain lion was installed via App Store anyway.
    So here's what I done so far:
    tried resetting PRAM - No success
    Done disk utility. Disk verified with no errors. I even re formatted disk. - no success starting.
    Tried re installing mountain lion via download . It froze halfway installing -no success.
    Tried backing up a time machine backup from my USB hard drive. It froze at 1% - no success
    Tried booting from safe mode - no success
    Tried the command line boot - no success.
    Please someone help!

    Sounds like the hard dre has left the building, Died, in the Sh*tter, Gone to the hard drive resting place in the sky.
    Buy a new drive connect it to the system with a SATA to USB adapter and see if you can install Mt Lion on that drive connected externally. If you can then the drive inside your system has failed.
    Oh Wait!!!! You have the 2009 model. They are known for bad drive to logic board cables. So it may not be the drive itself but the cable going from the drive to the logic board. Do the same as above then if the system runs OK with the new drive connected externally install it in the system and see if it boots. If it does you are good to go. If it doesn't then it is more then likely the cable that hs failed.
    I would suggest you also SAVE a copy of that download of Mt Lion and create a USB install drive from it using Lion Disk Maker, once you get your system up and running.

  • I came into the store because my middle button was not working. Then they gave me a middle button that's on the screen of my phone. I got a new phone do now my middle button doesn't work but I still have the internal digital button, how do I remove it?

    I came into the store because my middle button was not working. Then they gave me a middle button that's on the screen of my phone. I got a new phone do now my middle button doesn't work but I still have the internal digital button, how do I remove it?

    Settings>General>Accessibility>(scroll down to)AssitiveTouch and change to Off

  • My external Apple USB Keyboard letters doesn't work, but the numbers do. Why and how can I fix this issue?

    My external Apple USB Keyboard letters doesn't work, but the numbers do. Why and how can I fix this issue? Also, When I open the Keyboard Viewer, the letters will highlight only if I hold the modifier key(s) "Control" or "Control and Option". I really need help with this. I don't have any other computer to try it on, so I will have to test it on a friends computer sometime. But perhaps solutions that I can try right now? Thanks.

    Hello there, IDuncan23.
    The following Knowledge Base article has some great troubleshooting steps you can follow to work on resolving your keyboard issue:
    One or more keys on the keyboard do not respond
    http://support.apple.com/kb/ts1381
    Thanks for reaching Apple Support Communities.
    Cheers,
    Pedro D.

  • My "sent mail " tone doesn't work. All other tones do work.   I've changed tones and rebooted. Still silent

    "sent mail" tone doesn't work. All other tones do. What to do?
    ILive changed tones and rebooted

    Hi Gwing17,
    Welcome to the Apple Support Communities!
    I understand that all of your iPhone sounds are working as expected except for the Sent Mail sound. I understand that you have already changed the Sent Mail sound as well as reset your iPhone and the issue persists. In this situation, to isolate the issue, I would first recommend backing up your iPhone to either iTunes or iCloud.
    Back up and restore your iPhone, iPad, or iPod touch using iCloud or iTunes - Apple Support
    After you have backed up, I would recommend restoring your iPhone and setting it up as new to test the Sent Mail sound. If the sound works as expected, try restoring from your backup and test the sound again. Please let me know if the issue returns or if the sound still does not work when you set up your iPhone as a new device.
    Use iTunes to restore your iOS device to factory settings - Apple Support
    Cheers,
    Joe

  • I purchased an I pad giving my macbook to my husband.  His photo stream doesn't work but mine still goes onto macbook .  How can I stop that ?

    I purchased an I pad giving my macbook to my husband.  His photo stream doesn't work but mine still goes onto macbook .  How can I stop that ?

    Another item to consider is do you and your husband have your own iTunes accounts?  If so then log out of iTunes on your old Macbook and log back in with your husbands ID and password.  If not this post will self destruct in 10, 9, 8, ......
    OT

  • HT1212 My screen doesn't work but I want to connect my phone to iTunes. It's not letting me because I have to enter the passcode. What do I do?

    My screen doesn't work but I want to connect my phone to iTunes. It's not letting me because I have to enter the passcode. What do I do?

    My screen doesn't work but I want to connect my phone to iTunes.
    iPhone, iPad or iPod touch: Not responding or does not turn on
    It's not letting me because I have to enter the passcode.
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    Restore in Recovery Mode:
    iClarified - iPhone - How to Put an iPhone Into Recovery Mode
    If unsuccessful, try DFU mode:
    iClarified - iPhone - How to Put an iPhone Into DFU Mode
    After restoring, restore from back-up:
    iOS: How to back up
    OR
    Set as new iPhone:
    iOS: How to back up your data and set up as a new device
    Hope all this helps.

Maybe you are looking for

  • My repaint() doesnt work

    Hope somebody can help. I had posted this qtn on another site and got a response pointing to a java sun site talking about paint in general. unfortunately did not help. the issue is as follows: Heres the problem Have this drawing application with men

  • I bought Creative Suite years ago and I've lost the serial number.

    Is there some way to check my purchase history so I can get back to using the software?

  • Using functions GUI_DOWNLOAD/UPLOAD FM on HTMLGUI in EP

    Hi, I'd like to run GUI_UPLOAD/DOWNLOAD through EP-HTMLGUI. but I cannnot execute programs which contain GUI_UPLOAD or ITS_UPLOAD function module on HTMLGUI now . Our environment is NW7 with EP7 and ECC6. There is an ITS in the ECC6 system. The pehon

  • CRXI - Adding SQL subtables to already existing tables in a report

    Crystal Reports XI SQL 2005 I have a SQL 2005 set of tables and subtables with their respective fields.  In one of a pre-existing CRXI report there's an Opportunity table which now has a new "Opportunity_Details" subtable related to the original Oppo

  • Magic Mouse Right Click not responding

    Merry Christmas All! Just this morning my magic mouse (2 months old) stopped right clicking. When I press on the right side of the mouse, it doesn't right click or even "normal" click. I double checked my mouse settings in Preferences and "Secondary