The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

JSP mailing script not working

Discussion in 'E-mail Discussions' started by its_joe, Feb 4, 2008.

  1. its_joe

    its_joe Well-Known Member

    Joined:
    Feb 15, 2007
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    We have CentOS and WHM 11 installed on the server. Along with this we have apache-tomcat-5.5.25 .

    Now one account on the server has JSP mailing script that is not working. The script is as follows:

    ====================================================
    <%@ page import="sun.net.smtp.SmtpClient, java.io.*" %>
    <%
    String from="abc@domain.com";
    String to="herman_white@yahoo.co.in";
    try{
    SmtpClient client = new SmtpClient("mail.domain.com");
    client.from(from);
    client.to(to);
    PrintStream message = client.startMessage();
    message.println("To: " + to);
    message.println("Subject: Sending email from JSP!");
    message.println("This was sent from a JSP page!");
    message.println();
    message.println("Cool beans! :)");
    message.println();
    message.println();
    client.closeServer();
    }
    catch (IOException e){
    System.out.println("ERROR SENDING EMAIL:"+e);
    }
    %>
    =====================================================

    Now when the mail is send in the mail logs i get the following error message:

    56068 is currently not permitted to relay through this server. Perhaps you have not logged into the pop/imap server in the last 30 minutes or do not have SMTP Authentication turned on in your email client.

    So please give us the solution for this issue.

    Waiting for the replies.

    its_joe
     
  2. appservermgr

    appservermgr Member

    Joined:
    Feb 16, 2007
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
Loading...

Share This Page