Is SMTP SSL on port 587 possible ?

Hi,
I read that TLS is fully supported but is SMTP/S submission on port 587 possible ?
Thx for your help
Emmanuel

Have you specifically configured your mail server to use port 465?
By default, Mac OS X Server doesn't use this port.
Port 465 is used by SSMTP but Mac OS X Server doesn't implement this. It uses the more common SMTPS (SMTP w/ TLS).
The main difference is that SSMTP encrypts the entire connection (like HTTPS vs HTTP) whereas SMTPS starts off unencrypted and then switches to SSL when both the client and the server recognize that each other support it. SMTPS is far more widely implemented (and it's what Mail.app, amongst others, uses).

Similar Messages

  • Come on, honestly: ESMTP (port 587) - possible or not?

    Hi all,
    a special question to the ones invoked into JavaMail:
    Is a connection to a ESMTP-server (port 587) possible with JavaMail? (And if yes - how?)
    Certainly this is about sending mails via Gmail. And yes, I read http://java.sun.com/products/javamail/FAQ.html#gmail - and tested the demo-program. It works, but it turned out to use port 465. The problem is that Google advises its users to use port 587 und if you offer a webmail-client (which allows people to set a custom SMTP-port), these users will choose 587.
    I read tons of howtos und code-examples and tried out dozens combinations of properties-settings and SMTPTransport-Connects, but I didn't succeed to send a message to Gmails server on port 587. The "best" I got was a "javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?". Most of the time JavaMail tried to fallback and failured on port 25.
    I feel like "shetline2" on this thread:
    http://forum.java.sun.com/thread.jspa?forumID=43&threadID=706550
    He faced exactly the same experiences like me. Unfortunately this thread ended without a solution.
    And one more bonus-question:
    Is it possible to determine "on-the-fly" which kind of "secure connection" the server expects? In my Thunderbird I found "TLS - if possible"!??
    Thanks a lot for all hints and stuff!
    Best regards
    Stephan
    This is to show that I wasn't to lazy to try out (all the commented lines were one      unsuccessful shot):
    public static Session assembleJavaxMailSession(SmtpConnectionBean
    smtpConnection) {
    // Welches Protokoll?
    String proto = smtpConnection.isSslConnection() ?
    MailTransportProtocolEnum.SMTP_SSL.getProtocolId() :
    MailTransportProtocolEnum.SMTP.getProtocolId();
    // Properties holen und Werte aus der Bean setzen
    Properties props = getProperties();
    // props.setProperty("mail.transport.protocol", proto);
    // props.setProperty("mail." + proto + ".host", smtpConnection.getSmtpHost());
    // props.setProperty("mail." + proto + ".port", smtpConnection.getSmtpPort());
    // props.setProperty("mail." + proto + ".quitwait", "false");
    // // Bei SSL noch ein paar mehr Properties...
    // if(smtpConnection.isSslConnection()) {
    // props.setProperty("mail.smtps.socketFactory.class",
    // "javax.net.ssl.SSLSocketFactory");
    // props.setProperty("mail.smtps.socketFactory.port",
    // smtpConnection.getSmtpPort());
    // props.setProperty("mail.smtps.socketFactory.fallback", "false");
    // props.setProperty("mail.smtps.starttls.enable","true");
    props.setProperty("mail.smtp.host", smtpConnection.getSmtpHost());
    props.setProperty("mail.smtp.port", smtpConnection.getSmtpPort());
    // // SMTP-Auth?
    // SmtpAuthenticator smtpAuthenticator = null;
    // String smtpAuthUser = smtpConnection.getSmtpAuthUser();
    // String smtpAuthPass = smtpConnection.getSmtpAuthPass();
    // if((smtpAuthUser != null) && (smtpAuthPass.length() >= 1) &&
    // (smtpAuthPass != null) && (smtpAuthPass.length() >= 1)) {
    // smtpAuthenticator = new SmtpAuthenticator(smtpAuthUser, smtpAuthPass);
    // // Authentifizierung erzwingen
    // props.setProperty("mail." + proto + ".auth" , "true");
    // Session session = Session.getInstance(props, smtpAuthenticator);
    Session session = Session.getInstance(props, null);
    // Just in case...
    session.setDebug(true);
    return(session);
    // javax.mail.Session und MimeMessage erstellen
    Session jms = JavamailUtils.assembleJavaxMailSession(smtpConnection);
    MimeMessage mm = this.assembleMimeMessage(mailBasis, jms,
    facesContext.getViewRoot().getLocale());
    // Mail versenden
    // // Der einfache Weg
    // Transport.send(mm);
    // // Der komplizierte Weg
    // SMTPTransport transport =
    // (SMTPTransport)jms.getTransport(smtpConnection.isSslConnection() ?
    // MailTransportProtocolEnum.SMTP_SSL.getProtocolId() :
    // MailTransportProtocolEnum.SMTP.getProtocolId());
    // transport.setStartTLS(true);
    // transport.connect(smtpConnection.getSmtpHost(),
    // smtpConnection.getSmtpPortAsInt(),
    // smtpConnection.getSmtpAuthUser(),
    // smtpConnection.getSmtpAuthPass());
    // transport.sendMessage(mm, mm.getAllRecipients());
    // transport.close();
    // Welches Protokoll?
    String protocol = smtpConnection.isSslConnection() ?
    MailTransportProtocolEnum.SMTP_SSL.getProtocolId() :
    MailTransportProtocolEnum.SMTP.getProtocolId();
    SMTPTransport transport = (SMTPTransport)jms.getTransport(protocol);
    // SMTP-Auth?
    String smtpAuthUser = smtpConnection.getSmtpAuthUser();
    String smtpAuthPass = smtpConnection.getSmtpAuthPass();
    if((smtpAuthUser != null) && (smtpAuthPass.length() >= 1) &&
    (smtpAuthPass != null) && (smtpAuthPass.length() >= 1)) {
    jms.getProperties().setProperty("mail." + protocol + ".auth", "true");
    transport.connect(smtpConnection.getSmtpHost(),
    smtpConnection.getSmtpPortAsInt(),
    smtpConnection.getSmtpAuthUser(),
    smtpConnection.getSmtpAuthPass());
    else {
    transport.connect();
    transport.sendMessage(mm, mm.getAllRecipients());
    transport.close();

    I haven't evaluated all the details of the RFC 2476, but it works fine for me.
    Use:
    java -Dmail.smtp.starttls.enable=true -Dmail.smtp.port=587 smtpsend -A -d -M smtp.gmail.com -U user -P password ...You can't directly find out which type of connection the server expects,
    but you can try the different connection types until one works.

  • Port 25 works fine for SSL/SMTP, but not port 587?

    So after doing a rather painful migration to new hardware to support 10.5 from a previously working 10.4 config...
    I got SSL working -- web service is fine, mail service is fine for all ports for POP and IMAP...but not port 587.
    - It's open on my firewall
    - There's no software firewall impeding it
    - Trying to telnet to port 587 results in nothing
    It's as if the server isn't even listening to the port...
    And the odd part?
    - Mac OS X desktop clients report they can't connect on 587. Changing the port to 25 and leaving everything else the same (auth type, username, password) -- suddenly it works...BUT
    - The iPhone is configured for port 587 and works every time.
    My guess it that iPhone auto falls back to port 25 if all else fails, I can't explain why it would work. Bigger question, I suspect something got munged in the migration...is it possible it needs to be told to listen on 587 as well?

    I saw that site...it mentions adding port 587 specifically -- or commenting out "the appropriate lines of master.cf"
    I assume that means to uncomment out the submission port in that file -- or would it be better to add 587 specifically?
    Also, I never allow unauth SMTP (even inside my network) -- I would want to continue to impose that on the submission port and the normal port 25; how do I do this?
    Thanks in advance for the help.

  • Authenticated SMTP/SSL over port 465

    Does Oracle E-mail support authenticated SMTP over SSL on port 465? - E

    Yes,
    both TLS and SSL are possible with 10.1.1. Tried myself. A little bit tweaking essmi's accordingly, applying certificates, and adjusting listener.ora for LISTENER_ES.
    Note: essmi only.
    - Torsten

  • Cannot send email via Hotmail through port 587 with Secure Connection (SSL) set

    Something is blocking my attempts to send email (with Outlook Express) via my hotmail.com account. The error I receive is as follows:
    Your server has unexpectedly terminated the connection. Possible causes for this include server problems, network problems, or a long period of inactivity. Account: 'Hotmail', Server: 'smtp.live.com', Protocol: SMTP, Port: 587, Secure(SSL): Yes, Error Number: 0x800CCC0F
    When Hotmail.com first changed over to a POP3 server (Sept 2009), I could send emails through them using port 587, which they require. But then something happened, with no changes on my part, to disable my ability to send.
    I have checked and rechecked my Outlook Express account settings. I can send email through another third-party mail account (at 1&1 Internet.com) using port 587, which does not require setting SSL to yes. I can also ping the Hotmail SMTP server via port 587 and receive a response from it.
    I connect to Verizon DSL via a Westell 327W modem/router. Clearly it is not blocking port 587 without SSL. Does it have the capability to block SSL traffic? Or is the Verizon server the culprit, not allowing emails to be sent via Hotmail.com?
    Two different computers on my LAN have the same problem sending emails via Hotmail.com. I have tried everything the Hotmail people have suggested; at this point they think it is an ISP problem, hence this post. This problem doesn't make sense to me and is driving me crazy. Can anyone help me with this?
    Thanks.

    You can still have your reply address set to your hotmail address. And you don't have to really remember to do anything. Configure your client for the HOTMAIL account with Verizon's outgoing server. It will automatically send via Verizon. You don't reveal your verizon.net address, you are just using their server to transmit.
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.
    "All knowledge is worth having."

  • Sending email using IMAP through SMTP Port 587

    Hi,
    I have been sending Mail Merged email to people in organizations that I am active in, using IMAP embedded in StarOffice 5.2 (on Windows 98 Second Edition). This worked fine until a few weeks ago when I received an error message stating that AOL, as part of their anti-spam efforts, was no longer accepting third-party emails on default port 25. All third-party email must now use port 587. I looked in the IMAP dialog and in the Tools -> Options dialog, but did not see any place to change the SMTP port. The AOL error message information page had instructions for changing the port in other applications (Outlook, Eudora, etc.), but not for StarOffice. So, I have some questions:
    1.Is it possible to change the port in StarOffice 5.2?
    2.If not, how does StarOffice 8 send Mail Merged email? Does it use IMAP, and if so, can the port be changed?
    3.Also, I like the integrated configuration in StarOffice 5.2, where database fields can be directly accessed in the Insert -> Fields -> Other dialog. In looking at the Mail Merge section in "SO8_What's New.pdf", it appears that Mail Merge in StarOffice 8 is restricted to predefined fields. Could I still access fields from my existing databases?
    These is a lot of questions, but right now I am blocked from sending Mail Merged emails which is imparing communications with volunteers who are running educational programs. I appreciate any and all help that anyone can provide.

    Please try this out!!!!!!!!!
    You can send emails using Outlook also. You can send email over Microsoft Exchange with this object (or another email server, using IMAP/POP).
    Sub SendMailOutlook(aTo, Subject, TextBody, aFrom)
    'Create an Outlook object
    Dim Outlook 'As New Outlook.Application
    Set Outlook = CreateObject("Outlook.Application")
    'Create e new message
    Dim Message 'As Outlook.MailItem
    Set Message = Outlook.CreateItem(olMailItem)
    With Message
    'You can display the message To debug And see state
    '.Display
    .Subject = Subject
    .Body = TextBody
    'Set destination email address
    .Recipients.Add (aTo)
    'Set sender address If specified.
    Const olOriginator = 0
    If Len(aFrom) > 0 Then .Recipients.Add(aFrom).Type = olOriginator
    'Send the message
    .Send
    End With
    End Sub

  • SMTP does not start on port 587

    I just activated IMAP and SMTP on an old G5 Server running the latest version of Leopard.
    Everything, but for one thing, runs fine.  IMAP works correctly from both the local network and any distant network I could try it.  SMTP runs fine on the local network but only on port 25.  Nothing is listening on port 587, or 465.  Hence, SMTP does not work from a distant network. 
    The firewall is off, but even from the localhost, or any machine for that matter, telneting to port 587 does not get an answer :
    telnet 127.0.0.1 587
    Trying 127.0.0.1...
    telnet: connect to address 127.0.0.1: Connection refused
    telnet: Unable to connect to remote host
    I did activate ssl for smtp in the Advance>Security tab.  It uses the same selfsigned certificate as IMAP, which works fine.  I can also tunnel in from a distant machine and SMTP will work. 
    I tried to uncomment the following four lines in master.cf
    #smtps     inet  n       -       n       -       -       smtpd
    #  -o smtpd_tls_wrappermode=yes
    #  -o smtpd_sasl_auth_enable=yes
    #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    but I only lost connection on port 25 and got nothing on port 587.  This feels good, but I have no idea where to go from here.
    Any one has any suggestion ?

    I understand well that this is exactly SMTP, but just running on a different port, port 587, for submission, while port 25 is for relaying between server
    That's pretty much it, except that port 587 should be configured to accept mail from authenticated users only (as determined by the line:
      -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    This enables authenticated users (e.g. users who have accounts on the server) to send mail through the server without restriction (e.g. they can be remote) while unauthenticated users (including remote mail servers sending mail to your domain) use the standard port 25
    should I uncomment the lines for smtps in order to use SSL ?
    smtps is still different from SMTP (25) and submission (587). Both SMTP and Submission can use SSL if you enable tls support - tls enables a connection to start off insecure/unencrypted and switch to encrypted if both the client and server acknowledge they support it. It's generally not recommended to require SSL/TLS unless you're sure every client that's going to use that service can support (and is configured to use) encryption.
    smtps (which requires SSL) is now deprecated in favor of TLS (which allows the server to support both encrypted and unencrypted connections on the same port number).

  • Smtp port 587 not working

    after upgrading from 10.5.2 to 10.5.4 we are no longer able to use port 587 for smtp... only port 25 no SSL works.
    we have followed the suggestions in the the below posts....
    http://discussions.apple.com/thread.jspa?messageID=7291740&#7291740
    (recommenting smtps inet n - n - - smtpd in /etc/postfix/master.cf to enable smtp to run in the first place)
    http://discussions.apple.com/thread.jspa?messageID=7513032&#7513032
    (enabling port 587 in /etc/postfix/master.cf)
    we are also getting the following warnings in mail.log
    Jul 19 14:04:07 xserve postfix/smtpd[5658]: warning: connect to private/tlsmgr: No such file or directory
    Jul 19 14:04:08: --- last message repeated 1 time ---
    Jul 19 14:04:08 xserve postfix/smtpd[5658]: warning: problem talking to server private/tlsmgr: No such file or directory
    Jul 19 14:04:08 xserve postfix/smtpd[5658]: warning: no entropy for TLS key generation: disabling TLS support
    however not sure if that is really related - as we are only using SSL certificates not requiring... so presumably smtp should still work?
    any help appreciated.

    btw. if we do a telnet test, it first establishes a connection but then we get the following instantly:
    "Connection closed by foreign host."
    also checked that the firewall is configured correctly and lets traffic on port 587 in...
    ds.

  • Require SSL for IMAP (and possibly, SMTP)

    Hello,
    I'm having quite a bit of trouble changing the server configuration to require SSL for IMAP connections on the server side.  (Ideally, I'd like to require SMTP to send email as well, but not require for outbound connections from other hosts as it may stop message delivery.)
    If anyone has had luck doing this on OS X Mountain Lion / Server.app it would be great if you could share your steps?
    Thx.

    It would be helpful is you could explain what your experience is, since there are many possibilities and knowing what you're encountering would help.
    The most obvious/common issue is that IMAPS (IMAP+SSL) uses port 993, not the normal IMAP 143.
    If your clients are configured to only use 143 then they will break until they're reconfigured to use 993.
    Since you don't mention whether you've checked port numbering, it's impossible to tell if that's your issue or not.
    As for SMTP, if your mail server accepts mail from any external hosts then you do NOT want to require SSL. Few, if any, remote mail servers support SSL for SMTP, so you'll just block any external servers from sending mail to your domain. I doubt your users want that.

  • Comcast Port 587 Not Working

    Comcast contacted me to change to port 587 because my account was sending spam. I've done this and can't send or receive email. I've restarted mail, my computer, I've checked and unchecked SSL. I've contacted Comcast and they say it's a Mac issue. I'm clearly doing something wrong, I just can't figure out what it is. I get mail on my iPhone using 587, but not my iMac. If it were possible to cut and paste on the iPhone, I wouldn't care, but need the iMac for document creation and response.
    Anyone know what little thing I'm not doing that could fix this problem?

    I recieved a similar email from Comcast saying "Comcast has determined that your computer(s) have been used to send unsolicited email ("spam"), which is generally an indicator of a virus."
    I have no idea why I recieved this (waiting for a representative from Comcast Customer Security Assurance to call me back), but I'm sure it's related to the port change from 25 to 587.
    Now I've been using port 465 for secure SMTP connections for... years probably. However, the configuration for server authentication seems to have changed.
    The solution was to change the username under authentication from "userxyz" to "[email protected]". (I use my primary Comcast username, in case that makes a difference.)
    The best part was when I called Comcast and they told me I had to call Apple for help configuring the Mail.app client. Yeah, it's their problem.

  • SMTP  SSL StartTLS Auth

    I need / would like have the CFMX 6.1 admin default
    connection to our SMTP server use either of these connection
    methods:
    SMTP AUTH over SSL on port 465
    OR
    STARTTLS on ports 587 or 25
    Is this possible with CFMX 6.1 ?
    ... any assistance would be appreciated....
    John

    jeiBean wrote:
    > I need / would like have the CFMX 6.1 admin default
    connection to our SMTP
    > server use either of these connection methods:
    >
    > SMTP AUTH over SSL on port 465
    >
    > OR
    >
    > STARTTLS on ports 587 or 25
    >
    > Is this possible with CFMX 6.1 ?
    SMTP AUTH over SSL on port 465 can be done if you set up a
    stunnel
    http://www.stunnel.org/) and
    then you don't need changes to your code.
    In all other cases you need to change code to use some
    component.
    Jochem
    Jochem van Dieten
    Adobe Community Expert for ColdFusion

  • I need to modify Postfix to listen to port 587

    Mountain Lion Server OS X 10.8.4
    Running Mail service with Postfix and Dovecot. In production with several mailboxes.
    I need to modify Postfix to listen to port 587. I should be able to telnet to port 587, and finally send mail via 587.
    587 already redirects to 25 via the firewall, but external devices need to visit the internal subnet without modifications to the mail app.
    At this stage I just want to get it working with password authentication.   SSL is a project for another day.
    Here's my understanding of the OS X Postfix config:
    /etc/services file:
    Maps service names to port numbers.  Port 25 is  "smtp" and port 587 is "submission".
    /etc/postfix/master.cf file:
    Loads Postfix preferences. Service configurations for "smtp" and "submission" are listed at the top of the file. Each service configuration can be modified with parameters (-o variable_name_here=value_here).
    I found many discussion boards with instructions for enabling 587. They suggest removing the comment syntax for the existing "submission" line:
    # submission inet n - - n - smtpd
    My server didn't have a comment, the line was already enabled:
    submission inet n - - n - smtpd
    I restarted services and 587 didn't work.
    Then I tried a more direct approach:
    587 inet n - - n - smtpd
    This had no effect.
    After each attempt to enable 587 I test with:
    telnet 127.0.0.1 587
    And I get: Connection Refused
    I used the Server app and turned Mail off and on. This stops and starts Postfix.
    I also used commands to restart Postfix:
    postfix stop
    postfix start
    sudo postfix stop
    sudo postfix start
    postfix reload
    sudo postfix reload
    Nothing opens 587.  Any ideas? Thanks in advance for your insights.
    -SE30Emulation

    @Kraftwerk: You cannot change the TCP port used for SMTP.  Well, technically, you can, but then no other mail servers on the Internet will find and communicate with your mail server.  So... forget that.
    The ISP controls the terms and conditions for the network connection, and particularly controls the network and network access.  There's just no way 'round that either, as the ISP has the network position to implement port blocks and firewalls, and usually the contractual authority to allow or deny access.
    With the proper (static) network connection and proper DNS, there is nothing to struggle with; this stuff works. 
    Which implies your ISP does not offer static connections, or there's an ISP error, or you're attempting to operate a mail server on a dynamic address.  None of this works.
    You might try mailhop service — if that's permitted within the limits of the terms of service — but it'll be easier and cheaper to host your mail elsewhere.  Or to get a static IP address and proper public DNS, if your ISP offers that. 
    SMTP services are also tied to DNS, as well; other mail servers use DNS checks to detect rogue (spam) servers, and a mail server erroneously configured on a dynamic IP address will have mismatched DNS, and other mail servers will detect that and drop mail from and often to that mail server; that server is indistinguishable from a spam engine.
    There's rather more the ISP can do as part of best-practices networking, too.  TCP port 25 connections both inbound and outbound are usually spam engines operating on malware-infested, so it's common to block that traffic to reduce the volume of spam.  Various ISPs will further blacklist dynamic IP address blocks, which means other SMTP servers using these blacklist services will ignore servers in these address ranges.
    Get static IP.  Or host elsewhere.  Or (if permitted) mail hop. 

  • Why port 587 as opposed to 25?

    This morning I booted up my computer, and suddenly, while I could receive all my mail on all my mail account, I couldn't SEND anything -- on either my .mac accounts, my comcast accounts, or my domain name account.
    While reading another thread here on this topic, someone suggested switching to port 587 instead of 25. I did so, and now my mac account sends perfectly.
    I'm glad of this, but why did this work? I always like to know why something works so I can troubleshoot in the future and know if it's a solution I can try for future problems.

    You are correct, sir. But something changed.
    It helped because while something changed to block connections on port 25, 587, which is also useable for email submission, was not blocked.
    Ff we Google "port 587" we find, among other things, the relevant RFC. RFCs are how internet standards are proposed and defined.
    http://www.ietf.org/rfc/rfc2476.txt
    One relevant section:
    "Port 587 is reserved for email message submission as specified in this document. Messages received on this port are defined to be submissions. The protocol used is ESMTP [SMTP-MTA, ESMTP], with additional restrictions as specified here.
    "While most email clients and servers can be configured to use port 587 instead of 25, there are cases where this is not possible or convenient. A site MAY choose to use port 25 for message submission, by designating some hosts to be MSAs and others to be MTAs."
    That's why.
    -Fred

  • Leopoard / Mail 3.1 and port 587

    Hello,
    I am starting with leopard and mail 3.1.
    I have to change the port to go to port 587.
    I canot find where to do it.
    Help please.

    Hello and thank you.
    However, I knew how to do it in previous release of Mail.
    As you said : there was a place called "réglages des serveurs" (tune the s"erveurs")
    Mail, preferences,account, advanced ...... but the "reglages des serveurs " does not exist anymore
    in Mail in the new release Mail 3.1
    Therefore I dont know how to change (SMTP) PORT from 25 to 587.

  • Email sending Problem:smtps---SSL---TLS??

    Hi,
    I Have a Problem bei Sending a email with Attachement from extranet, I have writting my Programm which will send my email Through TLS, with Thunderbird
    I can sending there alle emails through TLS, I have taking the seem Properties :
    emai Server Name, Protocol:smtp port:25 und througt TLS, so Now I will show you my Code und the compile Failure, I appreciate so much your Help, I don't find any Help here in Forum.
    My Code:
    public void sendAttachment(String ausgangsMailServer, String user, String password,String sender, String receiver, String filename) throws MessagingException{
              Properties properties = System.getProperties();          
              properties.put("mail.transport.protocol","smtps");
              properties.put("mail.smtps.ssl", "true");
              properties.put("mail.smtps.starttls.enable","true");
              properties.put("mail.smtps.auth", "true");
              properties.put("mail.smtps.debug", "true");
              properties.put("mail.smtps.socketFactory.port", "25");
              properties.put("mail.smtps.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
              properties.put("mail.smtps.socketFactory.fallback", "false");
    SecurityManager security = System.getSecurityManager();
              Session session = Session.getInstance(properties, new MailAuthenticator());                         
              Transport transport = session.getTransport("smtps");                    
              transport.connect(ausgangsMailServer, user, password);          
              Message message = getMessage(session, sender, receiver,filename);
              message.saveChanges();
              transport.sendMessage(message, message.getAllRecipients());          
              transport.close();
         public Message getMessage(Session session, String sender, String receiver, String filename) throws MessagingException{          
         Message message = new MimeMessage(session);                                                                                                                   
    message.setSubject("attachment");
         message.setFrom(new InternetAddress(sender));
         message.addRecipient(Message.RecipientType.TO, new InternetAddress(receiver));
         Multipart multipart = new MimeMultipart();
         BodyPart bp = new MimeBodyPart();
         bp.setText("Attachment Mail");
         multipart.addBodyPart(bp);
         bp = new MimeBodyPart();
         DataSource source = new FileDataSource(filename);
         bp.setDataHandler(new DataHandler(source));
         bp.setFileName(filename);     
         multipart.addBodyPart(bp);
         message.setContent(multipart);                              
         return message;
         public class MailAuthenticator extends Authenticator{
              public MailAuthenticator(){
              public PasswordAuthentication getPasswordAuthentication(){
                   return new PasswordAuthentication("radouane","mypaaword");
    And I call the methode sendAttachment in a EJB Methode I Use Jboss als Server in my web application.
    This is now my failure:
    05:07:21,382 INFO [STDOUT] javax.mail.NoSuchProviderException: smtps
    05:07:21,382 INFO [STDOUT] at javax.mail.Session.getService(Session.java:76
    4)
    05:07:21,382 INFO [STDOUT] at javax.mail.Session.getTransport(Session.java:
    689)
    05:07:21,382 INFO [STDOUT] at javax.mail.Session.getTransport(Session.java:
    632)
    05:07:21,382 INFO [STDOUT] at javax.mail.Session.getTransport(Session.java:
    612)
    I have Using a smtps protocol , by using smtp I Had this Failure:
    14:15:11,164 INFO [STDOUT] javax.mail.MessagingException: Exception reading res
    ponse;
    nested exception is:
    javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connecti
    on?
    14:15:11,164 INFO [STDOUT] at com.sun.mail.smtp.SMTPTransport.readServerRes
    ponse(SMTPTransport.java:1090)
    14:15:11,164 INFO [STDOUT] at com.sun.mail.smtp.SMTPTransport.openServer(SM
    TPTransport.java:986)
    14:15:11,164 INFO [STDOUT] at com.sun.mail.smtp.SMTPTransport.protocolConne
    ct(SMTPTransport.java:197)
    14:15:11,164 INFO [STDOUT] at javax.mail.Service.connect(Service.java:233)
    14:15:11,164 INFO [STDOUT] at javax.mail.Service.connect(Service.java:134)
    For your help I say Thanks.
    Radouane

    Hi,
    I want just writtefor you my javamail debug Infomationen by J2SE Application and bei J2EE application. By j2se was that sending successful, by j2ee application is a problem by TSL.
    Hier Debug for j2se application:
    DEBUG: setDebug: JavaMail version 1.4ea
    DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsys
    tems, Inc]
    DEBUG SMTP: useEhlo true, useAuth true
    DEBUG SMTP: useEhlo true, useAuth true
    DEBUG SMTP: trying to connect to host "mail.cs.tu-berlin.de", port 25, isSSL false
    220 mailhost.cs.tu-berlin.de ESMTP Postfix
    DEBUG SMTP: connected to host "mail.cs.tu-berlin.de", port: 25
    EHLO meknes
    250-mailhost.cs.tu-berlin.de
    250-PIPELINING
    250-SIZE
    250-VRFY
    250-ETRN
    250-STARTTLS
    250-ENHANCEDSTATUSCODES
    250 8BITMIME
    DEBUG SMTP: Found extension "PIPELINING", arg ""
    DEBUG SMTP: Found extension "SIZE", arg ""
    DEBUG SMTP: Found extension "VRFY", arg ""
    DEBUG SMTP: Found extension "ETRN", arg ""
    DEBUG SMTP: Found extension "STARTTLS", arg ""
    DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
    DEBUG SMTP: Found extension "8BITMIME", arg ""
    STARTTLS
    220 2.0.0 Ready to start TLS
    EHLO meknes
    250-mailhost.cs.tu-berlin.de
    250-PIPELINING
    250-SIZE
    250-VRFY
    250-ETRN
    250-AUTH PLAIN LOGIN
    250-ENHANCEDSTATUSCODES
    250 8BITMIME
    DEBUG SMTP: Found extension "PIPELINING", arg ""
    DEBUG SMTP: Found extension "SIZE", arg ""
    DEBUG SMTP: Found extension "VRFY", arg ""
    DEBUG SMTP: Found extension "ETRN", arg ""
    DEBUG SMTP: Found extension "AUTH", arg "PLAIN LOGIN"
    DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
    DEBUG SMTP: Found extension "8BITMIME", arg ""
    DEBUG SMTP: Attempt to authenticate
    AUTH LOGIN
    334 oioohbzfavsa7
    mnhgvas8799800U=
    30987hasabhsasa6
    Y2hiijsasisas=
    235 2.0.0 Authentication successful
    DEBUG SMTP: use8bit false
    MAIL FROM:<[email protected]>
    250 2.1.0 Ok
    RCPT TO:<[email protected]>
    250 2.1.5 Ok
    DEBUG SMTP: Verified Addresses
    DEBUG SMTP: [email protected]
    DATA
    354 End data with <CR><LF>.<CR><LF>
    From: [email protected]
    To: [email protected]
    Message-ID: <9971081.01168741860633.JavaMail.radouane@meknes>
    Subject: attachment
    MIME-Version: 1.0
    Content-Type: multipart/mixed;
    boundary="----=_Part_0_25199001.1168741860423"
    ------=_Part_0_25199001.1168741860423
    Content-Type: text/plain; charset=us-ascii
    Content-Transfer-Encoding: 7bit
    Attachment Mail
    ------=_Part_0_25199001.1168741860423
    Content-Type: application/octet-stream; name=filename
    Content-Transfer-Encoding: 7bit
    Content-Disposition: attachment; filename=filename
    Now by J2ee application---I use jboss:
    2007-01-14 03:27:28,769 INFO [STDOUT] DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
    2007-01-14 03:27:28,769 INFO [STDOUT] DEBUG SMTP: useEhlo true, useAuth true
    2007-01-14 03:27:28,769 INFO [STDOUT] DEBUG SMTP: trying to connect to host "mail.cs.tu-berlin.de", port 25
    2007-01-14 03:27:28,909 INFO [STDOUT] 220 mailhost.cs.tu-berlin.de ESMTP Postfix
    2007-01-14 03:27:28,909 INFO [STDOUT] DEBUG SMTP: connected to host "mail.cs.tu-berlin.de", port: 25
    2007-01-14 03:27:28,909 INFO [STDOUT] EHLO meknes
    2007-01-14 03:27:28,979 INFO [STDOUT] 250-mailhost.cs.tu-berlin.de
    250-PIPELINING
    250-SIZE
    250-VRFY
    250-ETRN
    250-STARTTLS
    250-ENHANCEDSTATUSCODES
    250 8BITMIME
    2007-01-14 03:27:28,979 INFO [STDOUT] DEBUG SMTP: Found extension "PIPELINING", arg ""
    2007-01-14 03:27:28,979 INFO [STDOUT] DEBUG SMTP: Found extension "SIZE", arg ""
    2007-01-14 03:27:28,979 INFO [STDOUT] DEBUG SMTP: Found extension "VRFY", arg ""
    2007-01-14 03:27:28,979 INFO [STDOUT] DEBUG SMTP: Found extension "ETRN", arg ""
    2007-01-14 03:27:28,979 INFO [STDOUT] DEBUG SMTP: Found extension "STARTTLS", arg ""
    2007-01-14 03:27:28,979 INFO [STDOUT] DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
    2007-01-14 03:27:28,979 INFO [STDOUT] DEBUG SMTP: Found extension "8BITMIME", arg ""
    2007-01-14 03:27:28,979 INFO [STDOUT] DEBUG SMTP: use8bit false
    2007-01-14 03:27:28,979 INFO [STDOUT] MAIL FROM:<[email protected]>
    2007-01-14 03:27:29,049 INFO [STDOUT] 250 2.1.0 Ok
    2007-01-14 03:27:29,049 INFO [STDOUT] RCPT TO:<[email protected]>
    2007-01-14 03:27:29,159 INFO [STDOUT] 554 5.7.1 <[email protected]>: Recipient address rejected: Access denied
    2007-01-14 03:27:29,159 INFO [STDOUT] DEBUG SMTP: Invalid Addresses
    2007-01-14 03:27:29,159 INFO [STDOUT] DEBUG SMTP: [email protected]
    2007-01-14 03:27:29,159 INFO [STDOUT] DEBUG SMTP: Sending failed because of invalid destination addresses
    2007-01-14 03:27:29,159 INFO [STDOUT] RSET
    2007-01-14 03:27:29,229 INFO [STDOUT] 250 2.0.0 Ok
    2007-01-14 03:27:29,229 INFO [STDOUT] QUIT
    2007-01-14 03:27:29,229 INFO [STDOUT] Error Sending:
    2007-01-14 03:27:29,229 INFO [STDOUT] Sending failed;
    nested exception is:
         class javax.mail.SendFailedException: Invalid Addresses;
    nested exception is:
         class javax.mail.SendFailedException: 554 5.7.1 <[email protected]>: Recipient address rejected: Access denied
    2007-01-14 03:27:29,229 INFO [STDOUT] java.lang.NullPointerException
    can someone tell me, where is my problem by j2ee application, it's a ejb class -using jboss-.
    Thanks ,
    Radouane
    Message was edited by:
    radouane.marjani

Maybe you are looking for

  • Mid 2010 iMac - 10.6.6 is UTD?

    One of my iMacs won't update to 10.6.7 - it's running 10.6.6 right now and says that is UTD. It's not a concern at this very moment - but when Lion comes out next month - it will be. There is no anti-virus. Great internet connection. HW profile is Mo

  • Error when reading of XML file

    Hi Guys Basically I wanted to read following parameter in the XML <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xs

  • How to reverse the cash journal posted entries in FBCJ

    Hi All In Cash journal (FBCJ) user has posted the document by mistakenly two times, is it possible to reverse the cash journal posted document. Please advise how to reverse the posted cash journal entries. Regards K.Gunasekar

  • Extractor parameter "maxsize " and ABAP parameter "s_s_if-maxsize"

    Hi folks Can anyone explain how the ABAP parameter s_s_if-maxsize is populated in the FETCH of an extractor function module? - Using RSA3 you get what you set, of course : 100 by default, - but how does an Infopackage populate this field ? There are

  • Problem while creating database using dbca

    Hi all, I am getting following error when I try to create a database (fresh installation) using dbca on linux ES4, oracle 10.2.0.1 (Rev2). Any help much appreciated. ORA-19624: operation failed, retry possible, ORA-19870: error reading backup piece /