.SMTPSendFailedException: 553 Sorry, over your daily relay limit.



I am using javamail to send mails through SMTP .

I am using authentication at server

I can send the email through the same email id by Outlook express but
when I try to send email by javamail it gives me
exception .SMTPSendFailedException: 553 Sorry, over your daily relay
limit.

Below is the java code that I am using
import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;
import java.io.*;
public class SendMailUsingAuthentication
{

private static final String SMTP_HOST_NAME =
"myserver.smtphost.com";
private static final String SMTP_AUTH_USER = "myusername";
private static final String SMTP_AUTH_PWD = "mypwd";

private static final String emailMsgTxt = "Online Order
Confirmation Message. Also include the Tracking Number.";
private static final String emailSubjectTxt = "Order Confirmation
Subject";
private static final String emailFromAddress =
"divyendu@xxxxxxxxxxxxxxxxx";

// Add List of Email address to who email needs to be sent to
private static final String[] emailList = {"abc@xxxxxxxxx",
"xyz@xxxxxxxxx"};

public static void main(String args[]) throws Exception
{
SendMailUsingAuthentication smtpMailSender = new
SendMailUsingAuthentication();
smtpMailSender.postMail( emailList, emailSubjectTxt, emailMsgTxt,
emailFromAddress);
System.out.println("Sucessfully Sent mail to All Users");
}

public void postMail( String recipients[ ], String subject,
String message , String from) throws
MessagingException
{
boolean debug = false;

//Set the host smtp address
Properties props = new Properties();
props.put("mail.smtp.host", SMTP_HOST_NAME);
props.put("mail.smtp.auth", "true");

Authenticator auth = new SMTPAuthenticator();
Session session = Session.getDefaultInstance(props, auth);

session.setDebug(debug);

// create a message
Message msg = new MimeMessage(session);

// set the from and to address
InternetAddress addressFrom = new InternetAddress(from);
msg.setFrom(addressFrom);

InternetAddress[] addressTo = new
InternetAddress[recipients.length];
for (int i = 0; i < recipients.length; i++)
{
addressTo[i] = new InternetAddress(recipients[i]);
}
msg.setRecipients(Message.RecipientType.TO, addressTo);


// Setting the Subject and Content Type
msg.setSubject(subject);
msg.setContent(message, "text/plain");
Transport.send(msg);
}


/**
* SimpleAuthenticator is used to do simple authentication
* when the SMTP server requires it.
*/
private class SMTPAuthenticator extends javax.mail.Authenticator
{

public PasswordAuthentication getPasswordAuthentication()
{
String username = SMTP_AUTH_USER;
String password = SMTP_AUTH_PWD;
return new PasswordAuthentication(username, password);
}
}

}

.



Relevant Pages

  • Re: Outlook could not logon to the outgoing mail server - Exchange server
    ... In the Exchange System Manager go to the SMTP Protocol --> Default ... Based on my experience,I think The root cause is your smtp server have been ... configured to require authentication,but your outlook 2003 and outlook ... express authentication are not being configured on the client. ...
    (microsoft.public.windows.server.sbs)
  • Re: Sending E-Mails from ASP.NET 2.0 page using System.Net.Mail
    ... You need to know if your external smtp server uses: ... of authentication to use. ... > I have been searching the web like mad for a solution to my SMTP problem. ... > Socket s4, Socket s6, Socket& socket, IPAddress& address, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Exchange SMTP Hole?
    ... Maybe authenticated SMTP using some weak credentials? ... A worrisome new kind of attack is making the rounds on the ... 2000 Server have relaying turned off by default!" ... authentication on any SMTP virtual server that faces the Internet. ...
    (Focus-Microsoft)
  • Re: Help with SSL for Exchange 2003
    ... and Outlook, however, I cannot get SMTP to work properly. ... If I select SSL encryption the error I get is: "Your server does not ... Event Category: Authentication ...
    (microsoft.public.exchange.admin)
  • Re: Security log errors 529, store.exe
    ... Authentication -> leaving only Anonymous access on and disabling Basic ... the virtual SMTP server. ... out WHO they are from the server logs, any server logs -- shouldn't Exchange ... Usually they come like 2-10-40 logon attempts within ...
    (microsoft.public.windows.server.sbs)