Send Mail through jsp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nickyeng
    Contributor
    • Nov 2006
    • 252

    #1

    Send Mail through jsp

    I send a bunch of data from jsp to my email.
    There following code is pieces from jsp.

    It compiled with no error.
    It runs successfully sent email to my email address, BUT sometimes it cannot.

    why it cannot ? How to removed my ip address from blacklist ? how to solve this problem ?
    Here is the message from console :
    Exception --> javax.mail.Send FailedException : Sending failed;
    nested exception is:
    javax.mail.Send FailedException : Invalid Addresses;
    nested exception is:
    javax.mail.Send FailedException : 554 The IP Address of the sender (60.xx.22.oo) was found in a DNS blacklist database and was therefore refused.

    Code:
    String subject = "This is subject ";
    String message = "";
        	
    String to = "sheng@xxx.com.my";  
    String from = "info@yyy.com.my";
        	
        	try {
        	
        	Properties props = new Properties();
        	props.put("mail.smtp.host","mail.asiam.com.my");
        	
        	Session ss = Session.getDefaultInstance(props, null);
        	
        	MimeMessage msg = new MimeMessage(ss);
    
        	InternetAddress addressfrom = new InternetAddress(from);
      		msg.setFrom(addressfrom);
        	
        	InternetAddress addressTo = new InternetAddress(to);
        	msg.addRecipient(Message.RecipientType.TO, addressTo);
        	
       
    	message = "Name : " + name + 
    				"\n" + "Address : " + address;
    					
        	msg.setSubject(subject);
        	msg.setContent(message, "text/plain");
        	Transport.send(msg);
  • etiainen
    New Member
    • Aug 2007
    • 40

    #2
    you might wanna try http://member.dnsstuff .com/pages/tools.php

    In IP tools you have spam database lookup and you can check which databases list your server. Then you can take actions... My guess is that all you need to do is send them a mail declaring that you've fixed the spam problem (but if you didn't chances are they'll list you again).

    Maybe better option would be to switch server if possible...


    May the source be with you!

    Comment

    Working...