Sending mail Problem (Urgent Please)

The following program mail coding program. I am in local System. Host is my server. But our Server (norton) firewall is enabled. I am not able to send any mail. Will you please tell me How to recover this problem or alter my coding. If anybody knows Please tell me.
<html>
<head>
<title>JSP JavaMail Example </title>
</head>
<body>
<%@ page import="java.util.*" %>
<%@ page import="javax.mail.*" %>
<%@ page import="javax.mail.internet.*" %>
<%@ page import="javax.activation.*" %>
<%
try
String host = "xxx.xxx.x.x";
String to = request.getParameter("to");
String from = request.getParameter("from");
String subject = request.getParameter("subject");
String messageText = request.getParameter("body");
boolean sessionDebug = false;
Properties props = System.getProperties();
props.put("mail.host", host);
props.put("mail.transport.protocol", "smtp");
Session mailSession = Session.getDefaultInstance(props, null);
mailSession.setDebug(sessionDebug);
Message msg = new MimeMessage(mailSession);
msg.setFrom(new InternetAddress(from));
InternetAddress[] address = {new InternetAddress(to)};
msg.setRecipients(Message.RecipientType.TO, address);
msg.setSubject(subject);
msg.setSentDate(new Date());
msg.setText(messageText);
Transport.send(msg);
out.println("Mail was sent to " + to);
out.println(" from " + from);
out.println(" using host " + host + ".");
catch(Exception e)
System.out.println("Error");
%>
</table>
</body>
</html>
Please tell me how to recover this problem
Thanks in advance
regards
pooja

Please tell me my mail coding is correct. If correct but i am not able receive any mail. what is the problem do u know. If you know please tell me
regards
pooja

Similar Messages

  • Confirmation Mail Problem (urgent Solution) Please

    Dear Guys,
    After over the Registration Process, I want to send one confirmation mail. Mail Coding is properly worked. Only mail sent to my company id. But not to send yahoo, rediff and other things. what is the problem. I have changed the coding lot of time. But i was confused. I don't know what is the exact solution. If anybody knows please tell me. Urgent thing.

    Hi This is My JSP mail coding. Any problem in my mail coding. Please see that and tell me what did i do the errors. I dont know what errors?
    String host="mail.myCompany.com";
    String from="[email protected]";
    String to=ss;               // �ss� is JSP requestParameter name "to address";
    String subject="Confirmation Mail From MyCompany";
    String text = � Hereafter You will Access my Company mails�;
    boolean sessionDebug = false;
    Properties props = System.getProperties();
    props.put("mail.host", host);
    props.put("mail.transport.protocol", "smtp");
    Session mailSession = Session.getDefaultInstance(props, null);
    mailSession.setDebug(sessionDebug);
    Message msg = new MimeMessage(mailSession);
    msg.setFrom(new InternetAddress(from));
    InternetAddress[] address = {new InternetAddress(to)};
    msg.setRecipients(Message.RecipientType.TO, address);
    msg.setSubject(subject);
    msg.setText(text.toString());
    Transport.send(msg);
    out.println("To: " + to);
    out.println("Subject:"+subject);
    out.println();
    out.println(text);
    response.sendRedirect("jseeken.jsp");
    Now I have installed the free smtp server. But I don't know how to configure. Please tell me the exact solutions. I am awating for your reply.
    regards
    pooja

  • Sending mail problem (please help)

    I have downloaded all necessary components javamail-1_2.zip and jaf1_0_1.zip. I included them in my classpath too (activation.jar and mail.jar). I used Exchange Server 2000 as smtp server. But when i try sending an email the message appears like this:
    sending error cannot relay for sending [email protected]
    When i tried the same code in my ISP (www.mycgiserver.com) it work very fine. Here is the code. Where is the problem? Please help me...
    <%
    // Take massege properties
    String mBody = request.getParameter("mBody");
    String from1 = request.getParameter("from");
    String to1 = request.getParameter("to");
    String subject = request.getParameter("subject");
    Properties props = new Properties();
    props.put("ipNo.........:25", "smtp.mail.blah.com");
    Session s = Session.getInstance(props,null);
    Message message = new MimeMessage(s);
    InternetAddress from = new InternetAddress(from1);
    message.setFrom(from);
    InternetAddress to = new InternetAddress(to1);
    message.setRecipient(Message.RecipientType.TO, to);
    message.setText(mBody);
    message.setSubject(subject);
    Transport.send(message);
    %>

    the problem i feel is in your smtp relay and probably not in ur code . some smtp relay servers are configured such that they relay only on authentication or from a specific IP or from a specific subnet mask only to prevent spammers . check out the info on ur local relay server and also see other postings specific on relay ....that shud be of help i guess

  • Sending Mail problem - Very Urgent

    I want to send mail through the Java code using struts framework.It works fine olny with the authentication.I want suggestions for sending mails without authentication.

    {color:red}CROSS POSTED{color}
    {color:0000ff}http://forum.java.sun.com/thread.jspa?threadID=5245789
    {color}
    Cross posting is rude.
    And as I noted on the other thread, looks like a identity fraud requirement to me.
    db

  • Not receiving incoming mail, but can send mail...Please Help!!

    Hi there,
    For the past 3 days, I have been able to send mail from my "mail" but not receive any new mail. I know I am getting mail, since it appears when i go to my gmail account, though after several attempts to change settings and such, I still cannot receive any new mail. Weirdly enough, I received some mail from 2004 on my mailbox, but nothing new.
    I have changed internet modems, and different wireless locations, nothing!
    Please please, any suggestions, would be much appreciated.
    Thanks,
    Karen

    So I am having this problem too! I am receiving my mail just fine on my older G3 running OS X 10.4.11
    It appears that the last mail I have in my box on this newer computer is from Friday around 2 pm. I am also a Cox customer, but because I am receiving it on the older computer--I don't see how it could be on their end. Any ideas--please post. Of course support is closed today!
    Becky

  • Germany - sending mail problem

    as many before am not able to send mail from my private email account - neither via edge nor when using wifi. However it works from my .Mac account. It is an SMTP issue. My ISP tells me that the server drops after ehlo. In order to gather some more information, I have this question to the proud folks sporting a new t- mobile iPhone since Friday:
    What SMTP server is recomended by t-mobile when sending via edge (if they do recomend one at all)?
    Anyone having the same problems out there with an idea why theserver may drop conection and a work around (other than using a different ISP)
    Thanx,
    Christoph

    Not sure but since .Mac's SMTP server is authenticated and this works when sending messages from the iPhone with your .Mac account, this indicates your ISP's SMTP server is not authenticated or something else is wrong.
    Did you transfer the account settings from your computer to the iPhone via the iTunes sync process?
    If so, try deleting the account and manually recreating the account on the iPhone but if this works and you did transfer the account settings from your computer to the iPhone via the sync process, be sure to deselect this option before the next sync or your changes made on the iPhone will be overwritten.

  • Send mail problem

    hello
    pleze i tried to send mails from a servlrt in my application
    i tried it from a sample in tomcat sendmail.jsp which is connect with
    a servlet that manuplates the name and content for tha mail
    the problem is
    i can't do it from my application which take this servlet and
    put it in WEB-APP in the Root it gave me an exception
    javax.naming.NameNotFoundException: Name mail is not bound in this Context
    pleze help how can i manuplate with it to put it in my application in root
    thanx

    u've got to put your code on the screen so we can have a look at what u might be doing wrong

  • 4 level masetr detail  problem urgent please

    hi all
    i have page with 4 level master detail first as a form and other as tables my problem is when i click on a record at the last table the second table stop the partial triger so when i chose any record in table 2 it didnt change data in table 3 and data still as it in table 3 and 4 without changing i need to solve this problem very very urgent
    please help me
    Edited by: user554540 on 31/12/2009 11:34 ص

    Do you have the partialTriggers set correctly on the 3rd and 4th level tables?
    As an alternative, you could write a custom selection listener for table 2 and programmatically ppr the 3rd and 4th tables..

  • Yet another can receive, but can't send mail problem.

    I’m having trouble with Mail. I have reviewed the various posts by others who have a similar problem. I’ve tried their suggestions, but none have worked for me. I just bought a new G5 PowerMac. I have set the account preferences exactly like my PowerMac G4 and PowerBook G4, but I cannot send messages on any account. I can receive messages. When I try to forward a message by clicking the forward button, nothing happens - no new reply window appears. Likewise, when I compose new message and click the send button nothing happens. My setting are correct and the same as the other Macs noted above. Both of them will send and receive messages using the same DSL connection as the G5. I have two hard drives on my G5 both with OS 10.4.3 installed. I use the second drive to start up on when I have trouble with my main drive. I started on the other drive, which had no mail settings, and tried to set up my accounts. In this case I got a message stating that the mail server could not be accessed. I went ahead and set the accounts anyway, then made sure the settings were correct. This implies that there is something wrong with my new G5 or there is a bug with Mail using the G5 since I have no problems with the other Macs. I haven't time to contact the help line and hope someone knows how to fix this problem.

    Hi Dancing Brave,
    Thanks for visiting Apple Support Communities.
    I recommend starting with the steps in this article if you are not able to send mail:
    OS X Mail: Troubleshooting sending and receiving email messages
    http://support.apple.com/kb/ts3276
    Best,
    Jeremy

  • Have a proble with a Send Mail server..Please Help Me..!!

    i Have a issue with my mail server running over linux server, i have a especific problem when i try to authentificate in server. i test with a 10.4 and 10.5 S.O. The trouble is when i try to send mail from my server, the mail can not send the mail but can receive the mail, the mail.app send the error it can't not send mail over the server. My server using the plaint text authentication and never send the mail. But a test with the microsof entourage and i can send mail without problems, the issue only happen with mail. Only can send mail if put the static ip address in my mac whithout dhcp not send and not valide with server. I test from out side of my server and other ISP but i not have result.

    Have you tried holding the MENU and SELECT (center) buttons until you see the Apple logo to reset it?
    Cheers!
    -Bryan

  • Send Mail Problem with .Mac

    I cand send mail successfully from other accounts configured on the phone(both POP and IMAP), but I get errors when sending from my .Mac account.
    I found this article:
    http://www.wireless.att.com/support/knowledgeBase.do?content=KB72769.html
    ...but .Mac account config pages on the iPhone don't provide a field for Outgoing Server to change. Actually, this article fixed the problem with my other accounts.

    Thanks for the reply, Nathan.
    I had already found that article. Snip below...
    iPhone includes preset configurations for many of the
    popular providers such as Yahoo! Mail, Gmail, .Mac,
    and AOL, and in most cases sending mail will just
    work.
    However if you are using a different provider
    than above...
    Unfortunately, if you select ".Mac" for type of
    account, the configuration screen does not provide a
    field at all for Outgoing Server. This suggestion
    only works if you are not using one of the providers
    listed. It is apparently hardcoded by Apple when you
    choose ".Mac". I also tried to fool it by creating a
    generic IMAP account, but providing my .Mac info.
    This didn't work either.
    then don't select .mac, just select "Other", then select POP (or IMAP).
    incoming mail server: mail.mac.com
    outgoing mail server: smtp.mac.com:587
    enter in your username and password
    i set up my .Mac email manually by selecting "Other" and choosing POP and it is working fine.

  • Still Cant send mail? HELP PLEASE!

    I am connected to the server.
    POP3 and SMTP look corrected.
    Connection doctor says I am connected to the server.
    I can receive mail.
    but
    I CANT SEND ANYTHING.
    Please help can someone tell me why post is not going!

    even i am facing the same issue i am using email account which is on exchange server 2008 and able to recieve emails perfectly fine but, issue is when i try to send email thru my Mac mail client ( mail 3.0 [930.3]) it gives error. I checked this connection doctor as well didnt got any error messAGE authentication was done . But still cant send mail out checked for ports as well all are open on router firewall but still no luck can anyone help me on this. Thanks

  • Sending mail problems -- help

    hello all,
    I have two databases one in a DMZ and one that is not call it (local)
    On local I have created a mail procedure that can send mail to users.
    The same procedure does not work on the machine in the DMZ.
    I thought it might have something to do with being in the DMZ
    so I created an account in microsoft express and sent my self a message which I recieved.
    Any help on why I can't get the database procedure to work would be apprecieated.
    <<<<<<Code Below >>>>
    CREATE OR REPLACE PROCEDURE "CFULLER"."MAIL" ( TOPERSON IN
    VARCHAR2,FROMPERSON IN VARCHAR2,MESSAGE IN VARCHAR2)
    IS
    mailhost VARCHAR2(64) := '[email protected];
    recipient VARCHAR2(64) := TOPERSON;
    sender VARCHAR2(64) := FROMPERSON;
    mail_conn utl_smtp.connection;
    BEGIN
    mail_conn := utl_smtp.open_connection(mailhost, 25);
    utl_smtp.helo(mail_conn, mailhost);
    utl_smtp.mail(mail_conn, sender);
    utl_smtp.rcpt(mail_conn, recipient);
    utl_smtp.open_data(mail_conn);
    utl_smtp.write_data(mail_conn,MESSAGE);
    utl_smtp.write_data(mail_conn,'Mail host'||mailhost);
    utl_smtp.write_data(mail_conn,'get_user: ' || wwctx_api.get_user );
         utl_smtp.write_data(mail_conn,'get_user_id: ' || to_char(wwctx_api.get_user_id));
    utl_smtp.write_data(mail_conn,'get_db_user: ' || wwctx_api.get_db_user);
    utl_smtp.write_data(mail_conn,'get_product_version: ' || wwctx_api.get_product_version );
    utl_smtp.write_data(mail_conn,'get_product_schema: ' || wwctx_api.get_product_schema);
    utl_smtp.write_data(mail_conn,'logged_on: ' || to_char(wwctx_api.logged_on));
    utl_smtp.write_data(mail_conn,'get_sessionid: ' || wwctx_api.get_sessionid);
    utl_smtp.write_data(mail_conn,'get_login_time: ' ||to_char(wwctx_api.get_login_time,'MM/DD/YYYY HH24:MI:SS'));
    utl_smtp.write_data(mail_conn,'get_ip_address: ' || wwctx_api.get_ip_address);
    utl_smtp.write_data(mail_conn,'get_nls_language: ' || wwctx_api.get_nls_language);
    utl_smtp.write_data(mail_conn,'get_public_user: ' || wwctx_api.get_public_user);
    utl_smtp.write_data(mail_conn,'get_sso_schema: ' || wwctx_api.get_sso_schema);
    utl_smtp.write_data(mail_conn,'get_proxy_server: ' || wwctx_api.get_proxy_server);
    utl_smtp.write_data(mail_conn,'get_image_path: ' || wwctx_api.get_image_path);
    utl_smtp.write_data(mail_conn,'get_proc_path: ' || wwctx_api.get_proc_path ( 'home', 'portal30'));
    utl_smtp.write_data(mail_conn,'get_server_protocol: ' || wwctx_api.get_server_protocol );
    utl_smtp.write_data(mail_conn,'get_sso_proc_protocol: ' || wwctx_api.get_sso_proc_path ('home', 'portal30_sso' ));
    utl_smtp.write_data(mail_conn,'get_server_name: ' || wwctx_api.get_server_name );
    utl_smtp.write_data(mail_conn,'get_dad_name: ' || wwctx_api.get_dad_name );
    utl_smtp.close_data(mail_conn);
    utl_smtp.quit(mail_conn);
    EXCEPTION
    WHEN utl_smtp.INVALID_OPERATION then
    DBMS_OUTPUT.PUT_LINE ( 'INVALID_OPERATION : '|| sqlcode ) ;
    WHEN utl_smtp.TRANSIENT_ERROR then
    DBMS_OUTPUT.PUT_LINE ( 'TRANSIENT_ERROR : '|| sqlcode ) ;
    WHEN utl_smtp.PERMANENT_ERROR then
    DBMS_OUTPUT.PUT_LINE ( 'PERMANENT_ERROR : '|| sqlcode ) ;
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE ( 'Others : '|| sqlcode ) ;
    end mail
    ;

    The only thing I am getting for output is a value of 1
    If I comment out the portal api calls in this message it works fine.
    I am going to pass these values in a function call to a variable and concatenate them.
    I wish there was a example of tieing the utl_smpt mail functionality with the portal environment.
    This make life a lot easier to know what the person was doing when they had the problem.
    crf

  • Send mail problem having invalid address with correct addresses

    I used java mail api to send mails. the code is a s below
    javax.mail.Session mailSession=(javax.mail.Session)ctx.lookup("java:/Mail");
    mailSession.setDebug(false);
    javax.mail.Message msg = new javax.mail.internet.MimeMessage(mailSession);
    msg.addRecipients(javax.mail.Message.RecipientType.TO, addressToArr);
    msg.setSubject(mailSubject);
    msg.setContent(mailBody, contentType);
    javax.mail.Transport.send(msg);
    But if there is an invalid address in the recipient address array, the email won't be sent to the correct addresses as well. i just want to know whther it happens any coding issues or our mail server implementation.

    Hi!
    You need to activated properties config mail.smtp.sendpartial to true :
    // Setup partial mail
    props.put("mail.smtp.sendpartial", (new Boolean(partial)).toString());
    if the recipient address array have bad address, it will still be sent to good address...
    or/and check email address before send mail :
    public static boolean isValidEmail(String email)
              if (email == null) return false;
              boolean valid = true;
              try
                   InternetAddress addr = new InternetAddress(email);
                   addr.validate();
              catch (AddressException ex)
                   valid = false;
              return valid;
    }regards,

  • ODI send mail problem

    Hi,
    i am trying to send mail via ODI send mail package and getting error below,
    com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.1 Client was not authenticated
    any advise pls
    thank you

    ODI is sending the email without a password which is the behavior of OdiSendMail.
    Where as your mail server is looking for a authenticated mail i.e. which has password , this is why you are getting this error.
    For OdiSendMail , use a mail server which does not requires an authentication
    Else use customized Jython mail sending procedure ... see details in ODIsendmail error

Maybe you are looking for

  • HT4906 Iphoto nor Aperture are visible in my mac

    I cannot find iphoto nor aperture on my mac when im sure it was in my doc recently. once i click setting and then click on icloud i see iphoto is there but it doesnt have a check on it like the rest theres a button that says 'learn more' ive lready u

  • WHAT ARE SUB EVENTS OF EVENTS IN REPORTS ?

    WHAT ARE SUB EVENTS OF EVENTS IN REPORTS I.E INITIALIZATION, AT SELECTION SCREEN, START OF SELECTION, END OF SELECTION. WHAT ALL EVENTS HAVE SUB EVENTS ? PLEASE EXPLAIN IN DETAIL. REWARD POINTS GUARENTEED FOR ANSWERS!!

  • Acrobat 9 Lesezeichen + Struktur aus Dateinamen/Ordnerstruktur

    Sehr geehrte Forenleser, ich möchte 1 PDF Datei aus mehreren PF Dateien erstellen, als Lesezeichen soll der Dateiname genommen werden. Die einzelnen PDFs liegen in einer Ordnerstruktur bereit. Diese soll auch übernommen werden! Jedoch bekomme ich das

  • Can't get file time

    Hi, I need to get the file times for a file existing in the same directory as the exe file itself. However, the getfiletime function I'm using returns 0, which means it doesn't work. The error code is 87, ERROR_INVALID_PARAMETER. Could anyone see wha

  • OfficeJet 6500 709n and MicroSoft Office 2010 duplex print problem

    I have an OfficeJet 6500 709n and was able to automatically duplex print with Windows 2003 no problems.  I upgraded to Windows 2010 and now it won't see the automatic duplex printing.   I can only select single page printing and manual duplex printin