Java mail api: SendFailedException when trying to send Mail via SMTP

Hello,
I'm trying to send a mail via java mail api using a server that requires smtp authentication.
I'm currently using the following code:
protocol = "smtp";
host = "auth.smtp.profimailer.de";
port = 25;
String from="[email protected]";
String to="[email protected]";
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth", "true");
Authenticator auth = new PopupAuthenticator();
session=Session.getInstance(props,auth);
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from,"[email protected]"));
message.addRecipient(Message.RecipientType.TO,new InternetAddress(to,"ToName"));
message.setSubject("Hello JavaMail");
message.setText("Welcome to JavaMail");
Transport.send(message);
static class PopupAuthenticator extends Authenticator {
        public PasswordAuthentication getPasswordAuthentication() {
            return new PasswordAuthentication("e12345676", "mypass");
}When trying to run this code, I get the following exception:
D:\eclipse30RC1\workspace\ClassifyIt\bin>java -cp .;../lib/javamail.jar de.jwannenmacher.classify.TestMail > test.txt
javax.mail.SendFailedException: Send failed;
nested exception is:
javax.mail.SendFailedException: Sender "[email protected]" <jens
@jens-wannenmacher.de> was rejected: 501
at javax.mail.Transport.doSend(Transport.java:223)
at javax.mail.Transport.send(Transport.java:92)
at de.jwannenmacher.mail.pop3client.POP3Client.getAllNewMessages(POP3Cli
ent.java:176)
at de.jwannenmacher.classify.TestMail.main(TestMail.java:22)
Any suggestions on this?
Thanks and best regards,
Jens

Hi,
yes smtp is a standard and I think you could use this with almost every smtp server.
If your smtp server doesn't require authentication you can access it without an authenticator
I think...
Best regards,
Jens

Similar Messages

  • When trying to send mail, I get a message about rejected by server because it doesn't allow relaying.

    When trying to send mail I get a message the message was rejected by the server because it doesn't allow relaying!  I can send mail to myself but not anywhere else.

    See the previous discussions on the right side of this page under the heading "More Like This" with your same problem.

  • What does "Disk Full" message mean when trying to send mail?

    I have recently been getting an error message when trying to send email using Entourage - "cannot send mail using this account, disk full". Quiting all applications makes no difference, get the same message. To send email again I have to restart the computer. Then everything is fine until the next time, maybe a couple of days or weeks later.
    Any idea what the "disk" referred to in the message is? I have plenty of RAM (640 megs) and as I said earlier, even if I quit all open apps after getting the "disk full" message it makes no difference.
    Thanks for any suggestions!
    G3 Blueberry   Mac OS X (10.2.x)   Upgraded processor to 1000mz G4, OS 10.2.8

    Hello! Usually the disk full message occurs because the hard drive is at or near capacity. The message has nothing to do with apps except for the "virtual memory or paging" aspect of OSX. Restarting probably clears out the paging file and possibly some other stuff which allows you to work for a while. Select the hard drive and do a "get info" on it to see hoe much space is available on the hard drive. FREE space should be 10-20% and anything less than 10% will likely crash the computer or choke it to a slow crawl. Tom

  • Mail crashes when trying to send mail

    I am able to receive and read mail but when I select send mail, it brings up a new window and then crashes before I can enter any information.
    It also has large circles (approx. 3/4 inch) where it would normally list the number of new emails in a given account.
    Crash report:
    Date/Time: 2007-07-23 10:57:50.227 -0400
    OS Version: 10.4.10 (Build 8R218)
    Report Version: 4
    Command: Mail
    Path: /Applications/Mail.app/Contents/MacOS/Mail
    Parent: WindowServer [63]
    Version: 2.1 (752)
    Build Version: 1
    Project Name: MailViewer
    Source Version: 7520000
    PID: 238
    Thread: 0
    Exception: EXCBADACCESS (0x0001)
    Codes: KERNPROTECTIONFAILURE (0x0002) at 0x00000068

    Is this what you needed?
    Date/Time: 2007-07-23 16:32:00.290 -0400
    OS Version: 10.4.10 (Build 8R218)
    Report Version: 4
    Command: Mail
    Path: /Applications/Mail.app/Contents/MacOS/Mail
    Parent: WindowServer [63]
    Version: 2.1 (752)
    Build Version: 1
    Project Name: MailViewer
    Source Version: 7520000
    PID: 246
    Thread: 0
    Exception: EXCBADACCESS (0x0001)
    Codes: KERNPROTECTIONFAILURE (0x0002) at 0x00000068
    Thread 0 Crashed:
    0 com.apple.WebCore 0x95aabfc0 WebCore::RenderBlock::createLineBoxes(WebCore::RenderObject*) + 32
    1 <<00000000>> 0xa59d1e2c findValue(char const*, unsigned)::wordlist_value + 2236
    2 com.apple.WebCore 0x95aac034 WebCore::RenderBlock::createLineBoxes(WebCore::RenderObject*) + 148
    3 com.apple.WebCore 0x95aac034 WebCore::RenderBlock::createLineBoxes(WebCore::RenderObject*) + 148
    4 com.apple.WebCore 0x95aac034 WebCore::RenderBlock::createLineBoxes(WebCore::RenderObject*) + 148
    5 com.apple.WebCore 0x95aac034 WebCore::RenderBlock::createLineBoxes(WebCore::RenderObject*) + 148
    6 com.apple.WebCore 0x95aac034 WebCore::RenderBlock::createLineBoxes(WebCore::RenderObject*) + 148
    7 com.apple.WebCore 0x95aac034 WebCore::RenderBlock::createLineBoxes(WebCore::RenderObject*) + 148
    8 com.apple.WebCore 0x95aac034 WebCore::RenderBlock::createLineBoxes(WebCore::RenderObject*) + 148
    9 com.apple.WebCore 0x95aac034 WebCore::RenderBlock::createLineBoxes(WebCore::RenderObject*) + 148
    10 com.apple.WebCore 0x95aac034 WebCore::RenderBlock::createLineBoxes(WebCore::RenderObject*) + 148
    11 com.apple.WebCore 0x95aac034 WebCore::RenderBlock::createLineBoxes(WebCore::RenderObject*) + 148
    12 com.apple.WebCore 0x95aac034 WebCore::RenderBlock::createLineBoxes(WebCore::RenderObject*) + 148
    13 com.apple.WebCore 0x95aac034 WebCore::RenderBlock::createLineBoxes(WebCore::RenderObject*) + 148
    14 com.apple.WebCore 0x95aac34c WebCore::RenderBlock::constructLine(WebCore::BidiIterator const&, WebCore::BidiIterator const&) + 300
    15 com.apple.WebCore 0x95ab29c8 WebCore::RenderBlock::layoutInlineChildren(bool) + 3000
    16 com.apple.WebCore 0x95ac5a54 WebCore::RenderBlock::layoutBlock(bool) + 996
    17 com.apple.WebCore 0x95ab6ca0 WebCore::RenderBlock::layout() + 48
    18 com.apple.WebCore 0x95ac5228 WebCore::RenderBlock::layoutBlockChildren(bool) + 1176
    19 com.apple.WebCore 0x95ac5a8c WebCore::RenderBlock::layoutBlock(bool) + 1052
    20 com.apple.WebCore 0x95ab6ca0 WebCore::RenderBlock::layout() + 48
    21 com.apple.WebCore 0x95ac5228 WebCore::RenderBlock::layoutBlockChildren(bool) + 1176
    22 com.apple.WebCore 0x95ac5a8c WebCore::RenderBlock::layoutBlock(bool) + 1052
    23 com.apple.WebCore 0x95ab6ca0 WebCore::RenderBlock::layout() + 48
    24 com.apple.WebCore 0x95ac5228 WebCore::RenderBlock::layoutBlockChildren(bool) + 1176
    25 com.apple.WebCore 0x95ac5a8c WebCore::RenderBlock::layoutBlock(bool) + 1052
    26 com.apple.WebCore 0x95ab6ca0 WebCore::RenderBlock::layout() + 48
    27 com.apple.WebCore 0x95ac5228 WebCore::RenderBlock::layoutBlockChildren(bool) + 1176
    28 com.apple.WebCore 0x95ac5a8c WebCore::RenderBlock::layoutBlock(bool) + 1052
    29 com.apple.WebCore 0x95ab6ca0 WebCore::RenderBlock::layout() + 48
    30 com.apple.WebCore 0x95ac5228 WebCore::RenderBlock::layoutBlockChildren(bool) + 1176
    31 com.apple.WebCore 0x95ac5a8c WebCore::RenderBlock::layoutBlock(bool) + 1052
    32 com.apple.WebCore 0x95ab6ca0 WebCore::RenderBlock::layout() + 48
    33 com.apple.WebCore 0x95ac5228 WebCore::RenderBlock::layoutBlockChildren(bool) + 1176
    34 com.apple.WebCore 0x95ac5a8c WebCore::RenderBlock::layoutBlock(bool) + 1052
    35 com.apple.WebCore 0x95ab6ca0 WebCore::RenderBlock::layout() + 48
    36 com.apple.WebCore 0x95ad1958 WebCore::RenderView::layout() + 200
    37 com.apple.WebCore 0x95a472e0 WebCore::FrameView::layout(bool) + 1392
    38 com.apple.WebCore 0x95b66a70 WebCore::Selection::toRange() const + 80
    39 com.apple.WebKit 0x957b3d8c -[WebView(WebViewEditing) selectedDOMRange] + 60
    40 com.apple.mail 0x00061fcc 0x1000 + 397260
    41 com.apple.mail 0x000604ec 0x1000 + 390380
    42 com.apple.Foundation 0x92becc04 __NSFireDelayedPerform + 304
    43 com.apple.CoreFoundation 0x907f1578 __CFRunLoopDoTimer + 184
    44 com.apple.CoreFoundation 0x907ddef8 __CFRunLoopRun + 1680
    45 com.apple.CoreFoundation 0x907dd4ac CFRunLoopRunSpecific + 268
    46 com.apple.HIToolbox 0x9329ab20 RunCurrentEventLoopInMode + 264
    47 com.apple.HIToolbox 0x9329a12c ReceiveNextEventCommon + 244
    48 com.apple.HIToolbox 0x9329a020 BlockUntilNextEventMatchingListInMode + 96
    49 com.apple.AppKit 0x9377fae4 _DPSNextEvent + 384
    50 com.apple.AppKit 0x9377f7a8 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 116
    51 com.apple.AppKit 0x9377bcec -[NSApplication run] + 472
    52 com.apple.AppKit 0x9386c87c NSApplicationMain + 452
    53 com.apple.mail 0x000871d8 0x1000 + 549336
    54 com.apple.mail 0x00087080 0x1000 + 548992

  • Mail unexpectedly quits when trying to get mail

    Please help me, the person at the genius bar was useless. My mail unexpectedly quits only when trying to get mail. I have repaired permissions, and I did an archive reinstall (at the recommendation of the genius). Nothing I seem to do works, even when I removed the envelop index and started mail after getting re setup it just crashed again.

    Hi CurtRK, and a warm welcome to the forums!
    You mention the envelope, but how about the Cache, and doing it like this...
    Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, then move the following folder & file to the Desktop.
    Move this Folder to the Desktop...
    /Users/YourUserName/Library/Caches/Mail/
    Move this file to the Desktop...
    /Users/YourUserName/Library/Mail/Envelope Index
    Reboot.

  • Error message mes when trying to send PO via IDOCS to another system?

    Hi Abap expert,
    I am getting wired message what I ma trying to send PO via IDocs to other SAP system.
    I went to all partner , port configurations on WE20 and everything there seems to be fine but once I go to ME23N, then GO TO -> MESSAGES , than opens another windows when you key in MESSAGE CONTROL DATA that have been mantained
    in the outbound parameters in the PARTNER PROFILE configurations.Then I am getting the message :
    'No communication data has been defined for transmission medium 6'-----
    The LED on "PO:output screen' is YELLOW and never gets green.
    Can someone tell me how to overcome this and send my PO Idocs?Please some more details will be appreciate it!
    Thank you much eveyone!
    Boby

    Hi,
      Go and check it in NACE tcode, whether , Condition type, output types are maintained or not? if not maintained, Maintain it for 6 -PO for EDI.
    Hope this is the error you are getting.
    Thanks
    Manju

  • ME23N Error when trying to send PO via IDOCS to another system?

    Hello Experts,
    I am getting wired message what I ma trying to send PO via IDocs to other SAP system (XI)
    I went to all partner , port configurations on WE20 and everything there seems to be fine but once I go to ME23N, then GO TO -> MESSAGES , than opens another windows when you key in MESSAGE CONTROL DATA that have been mantained
    in the outbound parameters in the PARTNER PROFILE configurations.Then I am getting the message :
    'No communication data has been defined for transmission medium 6'-----
    The LED on "PO:output screen' is YELLOW and never gets green.
    Can someone tell me how to overcome this and send my  PO Idocs?Please some more details will be appreciate it!
    Thank you much  eveyone!
    Boby<b></b>

    I just got the same problem. Everything worked fine when i was using message type ORDERS01, but when i changed it to ORDERS05 this problem started happening.
    This might solve your problem. If you have it solved out can you tell us the solution you found??
    regards,
    Diogo

  • T-code ME23N message when trying to send PO via IDOCS to another system?

    Hello MM Experts,
    I am not sure if my question is more for ABAP guys , but since it is MM related  I decided to share it with MM experts as well.
    I am getting wired message what I am trying to send PO via IDocs to other SAP system (XI)
    I went to all partner , port configurations on WE20 and everything there seems to be fine but once I go to ME23N, then GO TO -> MESSAGES , than opens another windows when you key in MESSAGE CONTROL DATA that have been mantained
    in the outbound parameters in the PARTNER PROFILE configurations.Then I am getting the message :
    'No communication data has been defined for transmission medium 6'-----
    The LED on "PO:output screen' is YELLOW and never gets green.
    Can someone tell me how to overcome this and send my PO Idocs?Please some more details will be appreciate it!
    Thank you much eveyone!
    Boby<b></b>

    Hi Boby ,
    TRY going thru this link and check for the details given in it wether they are in place or not specially in the message controls, viz: application EF ,message type NEU and process code ME10
    http://help.sap.com/saphelp_47x200/helpdata/en/dc/6b7c9f43d711d1893e0000e8323c4f/frameset.htm
    regards
    kp

  • Mail app closes when trying to send email

    I can receive mail ok, but when I try to send, it just closes the mail app and goes back to the home page.
    Any suggestions how I can get the mail app working properly again?
    Thanks

    Ah, yes... a common problem.  Relaying is when you are using email service A to send mail through, but your "from" address is another service.  Service A, if it's set up for this, will reject your email because you are trying to relay the email through them from an email address that is not theirs.  This is to prevent spammers from using their service even though they don't have an account with them.
    I suspect the service you are sending to is one on which you have a valid account, but you're sending "from" another address.  In such cases the relaying service may allow you to specify, in your email settings, your account and password, in which case it will accept your email and pass it through.

  • ERROR MESSAGE WHEN TRYING TO SEND IPHOTO VIA E-MAIL

    DRIVING ME NUTS, CAN ANYONE ASSIST? TRYING TO SEND PHOTO'S FROM MY IPHOTO ACCOUNT VIA E-MAIL KEEP GETTING SERVER DOES NOT RECOGNISE ACCOUNT/PASSWORD MESSAGE. ALSO I-CLOUD ACCOUNT REFUSES TO ALLOW ME TO SELECT MAIL FROM MAIL, CONTACTS & CALENDARS PREFERENCE
    THANKS
    TED

    First unlock your caps lock key. Typing in all caps is inappropriate in online forums (considered shouting) and is hard to read.
    iPhoto>Preferences>General. Select the email program or how you wish to email photos from iPhoto.
    (There is an iPhoto forum for iPhoto questions).

  • When trying to send mail via Lotus Notes webmail, mail does not get send

    Firefox 4.01, XUL-manager installed.
    Logged in to corporate webmail, can see mails etc. I can create a mail (new, reply, etc.) but when I hit the send button, I get a popup asking if a copy needs to be archived. no matter if I say yes or no, the mail does not get send. Also saving as draft does not work.

    Hi,
    yes smtp is a standard and I think you could use this with almost every smtp server.
    If your smtp server doesn't require authentication you can access it without an authenticator
    I think...
    Best regards,
    Jens

  • Error when trying to send mail

    I have recently got Sky broadband and everything is working fine except I can't send mail I get this error
    "The server "smtp.sky.com" refused to allow a connection on port 465."
    Now I have checked my mail settings and all seems fine and sky tech help want give me specific help with Macs, any help would be gratefull
    Thanks Anthony.

    Disable SSL for SMTP. After disabling make sure, SMTP port is 25. If this does not work, try port 587 for SMTP (SSL still disabled).

  • Error When Trying To Send MMS via email

    Ive been trying to send an MMS via email. Ive got it to work a couple times but other times I get a message that says: MAILER-DAEMON.....etc....remote host said: 550 SMTP connection refused [BODY]"....
    I sent the pic message to a verizon phone by emailing to [email protected]
    please help. thanx.
    kev

    I'm not sure why a Verizon subscriber not updating the PRL for their phone affects this, but it can.
    As already provided, ask the Verizon subscriber to update the PRL for their phone per the instructions included with this link, which should resolve the problem.
    http://www.verizonwireless.com/care/popups/prl.html

  • Javax.mail.internet.ParseException when trying to send a MIME message

    Hi,
    I am using JavaMail to send a MIME message, but I am getting the following exception:
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at javax.mail.MessagingException.<init>(MessagingException.java:34)
    at javax.mail.internet.ParseException.<init>(ParseException.java:27)
    at javax.mail.internet.ParameterList.<init>(Compiled Code)
    at javax.mail.internet.ContentType.<init>(ContentType.java:82)
    at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1051)
    at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:1923)
    at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1904)
    at javax.mail.Transport.send(Transport.java:101)
    at FPSend.main(Compiled Code)
    The problem seems to be the header of the message, specifically the class-id filed of the content-type. This is the content-type header that causes javaMail to throw that exception:
    Content-Type: multipart/alternative;
    boundary="------------110059296832670";
    class-id=11:9sc9bnYwM87box:2680047
    I think the ":" character in the class-id is causing the problem. Does anybody know if those characters are valid according to MIME standards? And if they are not valid, is there a work around this problem?
    thank you!

    RFC 2046 doesn't mention the existence of the class-id parameter. But it does say this:Thus, a typical "multipart" Content-Type header field might look like this:
         Content-Type: multipart/mixed; boundary=gc0p4Jq0M2Yt08j34c0p
    But the following is not valid:
         Content-Type: multipart/mixed; boundary=gc0pJq0M:08jU534c0p
    (because of the colon) and must instead be represented as
         Content-Type: multipart/mixed; boundary="gc0pJq0M:08jU534c0p"From what I see elsewhere, Class-ID is a Microsoft extension. It wouldn't be surprising to find that Microsoft uses extensions that are incompatible with the MIME standards.

  • Receiving Relay Access Denied message when trying to send mail

    Hello,
    I have a client who getting the following error when sending a message:
    domainname-com.mail.protection.outlook.com[207.46.163.215] said: 550 5.7.0 Relay Access Denied (in reply to RCPT TO command)
    I think this is a Microsoft/outlook.com issue.
    Please advise.
    Have a great day,
    Don

    Hi,
    Please send emails to different addresses, check if the message will always return.
    What is the user's account type? If it's Outlook.com via Exchange ActiveSync, then we should check the service status on
    www.live.com. If the there's trouble sending from Web as well, it should be somthing related to the recipient's side, contact them via a possible portal and let them know that they seem to have rejected your emails.
    Thanks,
    Melon Chen
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

Maybe you are looking for