Why i can't send "MAIL FROM:"?

i wonder why i failed to send "MAIL FROM:" while commnunicating with the server using SMTP protocol?
my code is:
socket = new java.net.Socket(strServer, 25);
dis = new java.io.DataInputStream(socket.getInputStream());
dos = new java.io.DataOutputStream(socket.getOutputStream());
//send Mail from command to the server
dos.writeBytes("MAIL FROM: " + "[email protected]" + "\r\n");
response = readLastLine(dis); //get the last line of the reply
if (!response.startsWith("250")) { //if ok, response should starts with
//250, otherwise, wrong
destroyResource(socket, dis, dos);
return;
when i debug the program, i found the response starts with "500"
i don't know why?
can somebody give me the answer?

Wouldn't it be easier to just use the JavaMail API rather than
writing your own SMTP protocol support?
What message does the server include with its response?

Similar Messages

  • TS4291 I can't send mail from my iPad apps, I just get the error message, 'The recipient- was rejected by the server because it does not allow relaying.' Does anyone know what this means and how to fix the problem.

    I can't send mail from my iPad apps, I just get the error message, 'The recipient… was rejected by the server because it does not allow relaying.' Does anyone know what this means and how to fix the problem.

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    Using a POP account with multiple devices
    http://support.apple.com/kb/ht3228
    iOS: Adding an email account
    http://support.apple.com/kb/HT4810
    iOS: Setting up an Outlook.com, Hotmail, Live, or MSN email account
    http://support.apple.com/kb/ht1694
    Server does not allow relaying email error, fix
    http://appletoolbox.com/2012/01/server-does-not-allow-relaying-email-error-fix/
    Why Does My iPad Say "Cannot Connect to Server"?
    http://www.ehow.co.uk/info_8693415_ipad-say-cannot-connect-server.html
    How to Sync Contacts with Your iPad Using iTunes
    http://www.dummies.com/how-to/content/how-to-sync-contacts-with-your-ipad-using- itunes.html
    iOS: 'Mailbox Locked', account is in use on another device, or prompt to re-enter POP3 password
    http://support.apple.com/kb/ts2621
    eMail Groups - You can use a third party app that many users recommend.
    MailShot -  https://itunes.apple.com/us/app/mailshot-pro-group-email-done/id445996226?mt=8
    Group Email  -  https://itunes.apple.com/us/app/group-email!-mail-client-attachments/id380690305 ?mt=8
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Configuration problems with IMAP e-mail on iOS with a non-standard SSL port.
    http://colinrobbins.me/2013/02/09/configuration-problems-with-imap-e-mail-on-ios -with-a-non-standard-ssl-port/
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    Or this - Delete the account in Mail and then set it up again. Settings->Mail, Contacts, Calendars -> Accounts   Tap on the Account, then on the red button that says Remove Account.
     Cheers, Tom

  • I can't send mail from  mail application on my MAcbook but sends fine on iMac?

    I can't send mail from  mail application on my MAcbook but sends fine on iMac? This just started today...I checked to make sure the preferences were correct for the POP account and it's fine. HELP!

    Mail: Troubleshooting sending & receiving email messages (OS X Lion, Mac OS X v10.6)

  • How can i send mails from mac mail to a PC?

    When i send mails from my mac to a Pc (outlook) the mail arrive with a different format or including the mail as an atached document.
    How can i send mails from mac mail to a PC outlook with the same format?

    send it in "windows friendly format" when you click the paper clip for an attachment.

  • HT4519 I can't send mail from iPhone 4 checked settings and SMTP please can you help

    I can't send mail from iPhone I have checked the settings etc but still no joy.
    Can you help,please thanks.

    Follow the steps in the article below.
    iOS Unable to send or receive mail:
    http://support.apple.com/kb/ts3899
    Hope this helps

  • I can't send mails from my outlook 2010 but can receive, I can't send mails from my outlook 2010 but can receive

    I can't send mails from my outlook 2010 but can receive, please help.

    Thank you so much for your time and help Csound1 I really appreciate it.
    Mac mail works perfectly fine so I don't want to screw it up by altering anything there.
    However, I've checked to make sure I didn't miss anything on Outlook, but it still won't send messages. I don't know if I need to fill the "Unqualified domain" field?

  • How can i send mails from SAP?

    how can i send mails from SAP?
    what are the configurations i have to do in SAP for that?
    pls give me a detail reply......
    if possible, pls give me the sample ABAP program for that.

    recently i have worked on a similar requirement here is the sample code for that
    REPORT ZDOC_AS_EMAIL_3.
    *& Report ZEMAIL_ATTACH *
    *& Example of sending external email via SAPCONNECT *
    TABLES: ekko.
    PARAMETERS: p_email TYPE somlreci1-receiver.
    TYPES: BEGIN OF t_ekpo,
    ebeln TYPE ekpo-ebeln,
    ebelp TYPE ekpo-ebelp,
    aedat TYPE ekpo-aedat,
    matnr TYPE ekpo-matnr,
    END OF t_ekpo.
    DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
    wa_ekpo TYPE t_ekpo.
    TYPES: BEGIN OF t_charekpo,
    ebeln(10) TYPE c,
    ebelp(5) TYPE c,
    aedat(8) TYPE c,
    matnr(18) TYPE c,
    END OF t_charekpo.
    DATA: wa_charekpo TYPE t_charekpo.
    DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
    WITH HEADER LINE.
    DATA: it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
    WITH HEADER LINE.
    DATA: l_t_objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
    DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
    t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
    t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    w_cnt TYPE i,
    w_sent_all(1) TYPE c,
    w_doc_data LIKE sodocchgi1,
    gd_error TYPE sy-subrc,
    gd_reciever TYPE sy-subrc.
    *START_OF_SELECTION
    START-OF-SELECTION.
    *Retrieve sample data from table ekpo
    PERFORM data_retrieval.
    *Populate table with detaisl to be entered into .xls file
    PERFORM build_xls_data_table.
    *END-OF-SELECTION
    END-OF-SELECTION.
    *Populate message body text
    perform populate_email_message_body.
    *Send file by email as .xls speadsheet
    PERFORM send_file_as_email_attachment
                        tables it_message
                                it_attach
                            using p_email
        'Example . xls documnet attachment'
                                     'XLS'
                                'filename'
                        changing gd_error
                              gd_reciever.
    *Instructs mail send program for SAPCONNECT to send email(rsconn01)
    PERFORM initiate_mail_execute_program.
    *& Form DATA_RETRIEVAL
    *Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
    SELECT ebeln ebelp aedat matnr
    UP TO 10 ROWS
    FROM ekpo
    INTO TABLE it_ekpo.
    ENDFORM. " DATA_RETRIEVAL
    *& Form BUILD_XLS_DATA_TABLE
    *Build data table for .xls document
    FORM build_xls_data_table.
    *CONSTANTS: con_cret(2) TYPE c VALUE '0D', "OK for non Unicode
    *con_tab(2) TYPE c VALUE '09'. "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    class cl_abap_char_utilities definition load.
    constants:
    con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
    con_cret type c value cl_abap_char_utilities=>CR_LF.
    CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
    INTO it_attach SEPARATED BY con_tab.
    CONCATENATE con_cret it_attach INTO it_attach.
    APPEND it_attach.
    LOOP AT it_ekpo INTO wa_charekpo.
    CONCATENATE wa_charekpo-ebeln wa_charekpo-ebelp
    wa_charekpo-aedat wa_charekpo-matnr
    INTO it_attach SEPARATED BY con_tab.
    CONCATENATE con_cret it_attach INTO it_attach.
    APPEND it_attach.
    ENDLOOP.
    ENDFORM. " BUILD_XLS_DATA_TABLE
    *& Form SEND_FILE_AS_EMAIL_ATTACHMENT
    *Send email
    FORM send_file_as_email_attachment tables pit_message
                                              pit_attach
                                           using p_email
                                                p_mtitle
                                                p_format
                                              p_filename
                                        p_attdescription
                                        p_sender_address
                                    p_sender_addres_type
                                        changing p_error
                                              p_reciever.
    DATA: ld_error TYPE sy-subrc,
    ld_reciever TYPE sy-subrc,
    ld_mtitle LIKE sodocchgi1-obj_descr,
    ld_email LIKE somlreci1-receiver,
    ld_format TYPE so_obj_tp ,
    ld_attdescription TYPE so_obj_nam ,
    ld_attfilename TYPE so_obj_des ,
    ld_sender_address LIKE soextreci1-receiver,
    ld_sender_address_type LIKE soextreci1-adr_typ,
    ld_receiver LIKE sy-subrc.
    ld_email = p_email.
    ld_mtitle = p_mtitle.
    ld_format = p_format.
    ld_attdescription = p_attdescription.
    ld_attfilename = p_filename.
    ld_sender_address = p_sender_address.
    ld_sender_address_type = p_sender_addres_type.
    *Fill the document data.
    w_doc_data-doc_size = 1.
    *Populate the subject/generic message attributes
    w_doc_data-obj_langu = sy-langu.
    w_doc_data-obj_name = 'REPORT'.
    w_doc_data-obj_descr = ld_mtitle . "mail description
    w_doc_data-sensitivty = 'F'.
    *Fill the document data and get size of attachment
    CLEAR w_doc_data.
    READ TABLE it_attach INDEX w_cnt.
    w_doc_data-doc_size =
    ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
    w_doc_data-obj_langu = sy-langu.
    w_doc_data-obj_name = 'SAPRPT'.
    w_doc_data-obj_descr = ld_mtitle.
    w_doc_data-sensitivty = 'F'.
    CLEAR t_attachment.
    REFRESH t_attachment.
    t_attachment[] = pit_attach[].
    *Describe the body of the message
    CLEAR t_packing_list.
    REFRESH t_packing_list.
    t_packing_list-transf_bin = space.
    t_packing_list-head_start = 1.
    t_packing_list-head_num = 0.
    t_packing_list-body_start = 1.
    DESCRIBE TABLE it_message LINES t_packing_list-body_num.
    t_packing_list-doc_type = 'RAW'.
    APPEND t_packing_list.
    *Create 1st attachment notification
    t_packing_list-transf_bin = 'X'.
    t_packing_list-head_start = 0.
    t_packing_list-head_num = 1.
    t_packing_list-body_start = 1.
    DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
    t_packing_list-doc_type = ld_format.
    t_packing_list-obj_descr = ld_attdescription.
    t_packing_list-obj_name = ld_attfilename.
    t_packing_list-doc_size = t_packing_list-body_num * 255.
    APPEND t_packing_list.
    **Create 1st attachment notification
    *t_packing_list-transf_bin = 'X'.
    *t_packing_list-head_start = 0.
    *t_packing_list-head_num = 1.
    *t_packing_list-body_start = 1.
    *DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
    *t_packing_list-doc_type = ld_format.
    *t_packing_list-obj_descr = ld_attdescription.
    *t_packing_list-obj_name = ld_attfilename.
    *t_packing_list-doc_size = t_packing_list-body_num * 255.
    *APPEND t_packing_list.
    **Create 2nd attachment notification
    data: x type i.
    DESCRIBE TABLE t_attachment LINES X.
    append lines of it_attach to t_attachment.
    data: start type i,
          end type i,
          cal type i.
    start = X + 1.
    describe table t_attachment lines end.
    cal = end - start.
    t_packing_list-transf_bin = 'X'.
    t_packing_list-head_start = 0.
    t_packing_list-head_num = 1.
    t_packing_list-body_start = start.
    t_packing_list-body_num = end.
    *DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
    t_packing_list-obj_descr = 'Eng Change'. "ld_attdescription.
    t_packing_list-doc_type = ld_format.
    *t_packing_list-obj_name = 'Eng' .
    t_packing_list-doc_size = t_packing_list-body_num * 255.
    APPEND t_packing_list.
    *Add the recipients email address
    CLEAR t_receivers.
    REFRESH t_receivers.
    t_receivers-receiver = ld_email.
    t_receivers-rec_type = 'U'.
    t_receivers-com_type = 'INT'.
    t_receivers-notif_del = 'X'.
    t_receivers-notif_ndel = 'X'.
    APPEND t_receivers.
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
    EXPORTING
    document_data = w_doc_data
    put_in_outbox = 'X'
    sender_address = ld_sender_address
    sender_address_type = ld_sender_address_type
    commit_work = 'X'
    IMPORTING
    sent_to_all = w_sent_all
    TABLES
    packing_list = t_packing_list
    object_header = l_t_objhead
    contents_bin = t_attachment
    contents_txt = it_message
    receivers = t_receivers
    EXCEPTIONS
    too_many_receivers = 1
    document_not_sent = 2
    document_type_not_exist = 3
    operation_no_authorization = 4
    parameter_error = 5
    x_error = 6
    enqueue_error = 7
    OTHERS = 8.
    *Populate zerror return code
    ld_error = sy-subrc.
    *Populate zreceiver return code
    LOOP AT t_receivers.
    ld_receiver = t_receivers-retrn_code.
    ENDLOOP.
    ENDFORM.
    *& Form INITIATE_MAIL_EXECUTE_PROGRAM
    *Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
    WAIT UP TO 2 SECONDS.
    SUBMIT rsconn01 " WITH mode = 'INT'
    "WITH output = 'X'
    AND RETURN.
    ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
    *& Form POPULATE_EMAIL_MESSAGE_BODY
    *Populate message body text
    form populate_email_message_body.
    REFRESH it_message.
    it_message = 'Please find attached a list test ekpo records'.
    APPEND it_message.
    endform. " POPULATE_EMAIL_MESSAGE_BODY

  • Can not send mail from PR Workflow to the approver

    Dear all,
    I have issues about send mail from PR Workflow to the approver.
    Now when user create PR and the corresponding user can receive the workflow items in SBWP.
    But no email from the user to approver.
    If I assign authorization SAP_ALL to the user that create PR. The approver can recieve the workflow item PR in SBWP and email to their mail
    Can you tell me about the authorization that can allow the user to send the workflow item PR in SBWP and email to the approver?
    Now user can send mail to external and internal mail and I also configured the mail server in SCOT and can successfully send a mail to users in SO01 by manually creating a message.
    Now the approver not receive any email but can receive a workflow item in SBWP
    Regards,
    Pannee

    Dear all,
    Thank you for all suppport, Now I can solve issues.
    Regards,
    Pannee

  • I can't send mail from iphone4 using outlook

    I am able to receive mail, but cannot send mail from my iPhone4. I am using Outlook - please help!
    Thanks!

    Email does not sync to the phone via iTunes. Don't know where you got this idea. Email account info can be synced from a computer to the phone via iTunes, but that's it.
    If the OP told us what happens when he tries to send mail, it might actually be helpful in troubleshooting. Without this information, we're just shooting in the dark.
    That said, I'm willing to bet the SMTP server settings are incorrect.

  • Can not send mail from Solution Manager

    hi,
    We try to send mail from  Solution Manager workplace (SBWP). But when we try to send mail we get an error message "Address does not exist" .
    Best Regards

    Hi,
      If you have already configured SCOT,this can be an inconsistency. Please try to run the report: 'RSSODIAD'.
    I hope it helps.
    Regards,
    Sam

  • Firefox and Thunderbird do not communicate anymore : I can't open links from TB emails ( a href... ) and can't send mail from FF pages (mailto)

    Hi there,
    Please excuse me if a make a few mistakes, I am French ;)
    I come here because firefox and thunderbird are not working together anymore. This is what happens :
    - Firefox and Thunderbird are opened
    - I click on a link in an email
    - A few seconds after that a Firefox windows pops up. The title is : "Close Firefox", the content is : "Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system."
    Second case :
    - Firefox is closed and Thunderbird is open
    - I click on a link in an email
    - A few seconds after that a Firefox windows pops up as expected. Firefox opens the link as expected but doesn't opens the other tabs as usual (when i start FF it re-opens previous tabs)
    Third case :
    - Firefox and Thunderbird are opened
    - I click on a link to send an email (<a href="mailto:......@.....">)
    - A few seconds after that a Thunderbird windows pops up. The title is : "Close Thunderbird", the content is : "Thunderbird is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system."
    As in the second case, if TB is closed when i click on the mailto, TB opens properly and send the email.
    If Internet Explorer is set as my default browser, it works fine for "Thunderbird -> link -> IE" but the "IE-> mailto -> TB" still doesn't work.
    I already looked up for some answers on google but can't find something which works.
    Thank you in advance for your answers.
    Vincent

    Check the target field in the Firefox desktop shortcut and make sure that you do not start Firefox with the -no-remote switch or have set the environment variable MOZ_NO_REMOTE=1 (Control Panel > System > Advanced > Environment variables).
    Always make sure to start at least the default profile without the -no-remote command line switch.
    If you need to have more than one profile open at the same time then start subsequent instances with the -no-remote command line switch.
    You can not send links from other programs to a Firefox instance that is started with the -no-remote switch.
    In such a case you need to drag links in a Firefox window or paste the link in the location bar.

  • Why I can't update Mail from 4.5 to 5?

    I use Mail 4.5 and this is, denifitively, a poor client.
    Why I can't have Mail 5, in order to try something better?

    You'll have to wait for Lion this summer.  Then you can use Mail 5.
    http://www.apple.com/macosx/lion/
    Mail 4.5 is the latest version for Snow Leopard.
    Captfred

  • TS3899 can't send mail from iphone

    My email was hacked and I had to change my password.  When I went to change it on my Iphone it would not acknowledge it until I changed the password, about 8 times.  I finally got my mail back, but now I can't send mail saying the user name or password is incorrect and cannot send..  Now what do I do, I can't change the password in the send folder in settings.

    Who is the email account provider for the account, and what is the error message provided when an email can't be sent?

  • HT1393 Why my iPhone not send mails from my company account

    I have problem to send mail from my company mail to others. On my iphone

    Then talk to our company IT department.

  • TS3899 Can't send mail from iPad 2

    My wife's iPad 2 gives an error message "Cannot send mail SMPT: [email protected]@smpt.live.com is incorrect" It seems that two email addresses have concatinated.  Any help would be much appreciated.

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    Using a POP account with multiple devices
    http://support.apple.com/kb/ht3228
    iOS: Adding an email account
    http://support.apple.com/kb/HT4810
    iOS: Setting up an Outlook.com, Hotmail, Live, or MSN email account
    http://support.apple.com/kb/ht1694
    iPhone, iPad, iPod touch: Microsoft Outlook 2003, Outlook 2007, Outlook 2010 may not display contacts and calendars after sync
    http://support.apple.com/kb/TS1944
    Server does not allow relaying email error, fix
    http://appletoolbox.com/2012/01/server-does-not-allow-relaying-email-error-fix/
    Why Does My iPad Say “Cannot Connect to Server”?
    http://www.ehow.co.uk/info_8693415_ipad-say-cannot-connect-server.html
    How to Delete Email on the iPad
    http://ipad.about.com/od/iPad_Guide/ss/How-To-Delete-Email-On-The-Ipad.htm
    How to Mass Delete Emails from iPhone and iPad Inbox (with video)
    http://suiteminute.com/how-to-mass-delete-emails-from-iphone-and-ipad-inbox/
    How to add, send and open iPad email attachments
    http://www.iskysoft.com/apple-ipad/ipad-email-attachments.html
    How to Sync Contacts with Your iPad Using iTunes
    http://www.dummies.com/how-to/content/how-to-sync-contacts-with-your-ipad-using- itunes.html
    iOS: ‘Mailbox Locked’, account is in use on another device, or prompt to re-enter POP3 password
    http://support.apple.com/kb/ts2621
    iCloud: Create a group and add contacts to it
    http://support.apple.com/kb/PH2667
    eMail Groups - You can use a third party app that many users recommend.
    MailShot -  https://itunes.apple.com/us/app/mailshot-pro-group-email-done/id445996226?mt=8
    Group Email -  https://itunes.apple.com/us/app/mailshot-pro-group-email-done/id445996226?mt=8
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Configuration problems with IMAP e-mail on iOS with a non-standard SSL port.
    http://colinrobbins.me/2013/02/09/configuration-problems-with-imap-e-mail-on-ios -with-a-non-standard-ssl-port/
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    Or this - Delete the account in Mail and then set it up again. Settings->Mail, Contacts, Calendars -> Accounts   Tap on the Account, then on the red button that says Remove Account.
    How to delete an email account on your iPad
    http://www.shoppepro.com/support/knowledgebase/228/How-to-delete-an-email-accoun t-on-your-iPad.html
     Cheers, Tom 

Maybe you are looking for