Sie sind auf Seite 1von 33

Hello, I was trying to send mails via GMail's smtp server (smtp.gmail.

com) but the following


exception occurred. I used port 25 (used 467 also, didnt work). Would anybody tell what
the following exception mean. Thanx.

com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS


command first

Here's my code:

import javax.mail.*;

import javax.mail.event.TransportListener;

import javax.mail.event.TransportEvent;

import javax.mail.internet.*;

import java.util.Properties;

import javax.activation.*;

class MailSender {

private String mailHost="smtp.gmail.com";

private String body;

private String myFile="F:\\DRacing.avi";

private Properties props;

private Session mailSession;

private MimeMessage message;

private InternetAddress sender;

private Multipart mailBody;

private MimeBodyPart mainBody;

private MimeBodyPart mimeAttach;

private DataSource fds;

MailSender()
{

//Creating a Session

props=new Properties();

props.put("mail.transport.protocol", "smtp");

props.put("mail.smtp.host", mailHost);

props.put("mail.smtp.port", "25");

props.put("mail.smtp.auth", "true");

mailSession=Session.getDefaultInstance(props, new MyAuthenticator());

//Constructing and Sending a Message

try

//Starting a new Message

message=new MimeMessage(mailSession);

mailBody=new MimeMultipart();

//Setting the Sender and Recipients

sender=new InternetAddress("dider7...gmail.com", "Kayes");

message.setFrom(sender);

InternetAddress[] toList={new InternetAddress("thegreendove...yahoo.com")};

message.setRecipients(Message.RecipientType.TO, toList);

//Setting the Subject and Headers

message.setSubject("My first JavaMail program");

//Setting the Message body

body="Hello!";

mainBody=new MimeBodyPart();
mainBody.setDataHandler(new DataHandler(body, "text/plain"));

mailBody.addBodyPart(mainBody);

//Adding a single attachment

fds=new FileDataSource(myFile);

mimeAttach=new MimeBodyPart();

mimeAttach.setDataHandler(new DataHandler(fds));

mimeAttach.setFileName(fds.getName());

mailBody.addBodyPart(mimeAttach);

message.setContent(mailBody);

Transport.send(message);

catch(java.io.UnsupportedEncodingException e)

System.out.println(e);

catch(MessagingException e)

System.out.println(e);

catch(IllegalStateException e)

System.out.println(e);

}
}

public class TestMail01

public static void main(String args[])

new MailSender();

class MyAuthenticator extends Authenticator

MyAuthenticator()

super();

protected PasswordAuthentication getPasswordAuthentication()

return new PasswordAuthentication("dider7", "MY_PASSWORD");

}
Keywords & Tags: smtpsendfailedexception, 530, 5.7.0, issue, starttls, command, first,
enterprise
URL: http://www.thatsjava.com/java-enterprise/59856/

«« Prev - Next »» 19 helpful answers below.


Well, I've solved it anywayz.

thegreendovea | Tue, 10 Jul 2007 03:42:00 GMT |


Please tell me how did you resolve this issue because I am having the same problem,
thanks

llondono_javeriana_edu_coa | Tue, 10 Jul 2007 03:42:00 GMT |


Im facing the same problem as yours at april ... can u send me you solution or tell me as
you can? im urgent on my tasks... thanksthis is my email address. >
titan.nuiSkai...gmail.comTitan

titanloka | Tue, 10 Jul 2007 03:42:00 GMT |


Hi. I have same problem. Could you sent me the answer? My email address is
bo3po...hotmail.com

denondegaffela | Tue, 10 Jul 2007 03:42:00 GMT |


can u mail me how to resolve this problem plzksreedhar76...gmail.comThanks in advance

sseefolka | Tue, 10 Jul 2007 03:42:00 GMT |


just add this line before creating the Property for the
sessionjava.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); it
should work

naaza | Tue, 10 Jul 2007 03:42:00 GMT |


Can some one post the solution on this. It will help others to solve it with out requesting the
solution in mail

decaynana | Tue, 10 Jul 2007 03:42:00 GMT |


Please send us the solution....

felipe_gauchoa | Tue, 10 Jul 2007 03:42:00 GMT |

ok, after few minutes I figured out the great mistery:

the only thing you must do in your code to solve the problem is to add the following line:

props.put("mail.smtp.starttls.enable","true");

bellow is the complete code:

/*

* Created on 14/09/2005

* TODO To change the template for this generated file go to


* Window - Preferences - Java - Code Style - Code Templates

*/

package br.com.bnb.mail;

import java.util.Properties;

import javax.mail.Authenticator;

import javax.mail.Message;

import javax.mail.MessagingException;

import javax.mail.PasswordAuthentication;

import javax.mail.Session;

import javax.mail.Transport;

import javax.mail.internet.InternetAddress;

import javax.mail.internet.MimeMessage;

/**

* ...author gaucho

* TODO To change the template for this generated type comment go to Window -

* Preferences - Java - Code Style - Code Templates

*/

public class SendMailUsingAuthentication {

private static final String SMTP_HOST_NAME = "gmail-smtp.l.google.com";

private static final String SMTP_AUTH_USER = "from...gmail.com";

private static final String SMTP_AUTH_PWD = "password";

private static final String emailMsgTxt = "Please visit my project at ";


private static final String emailSubjectTxt = "Order Confirmation Subject";

private static final String emailFromAddress = "cejug.classifieds...gmail.com";

// Add List of Email address to who email needs to be sent to

private static final String[] emailList = { "to...gmail.com" };

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;

java.security.Security

.addProvider(new com.sun.net.ssl.internal.ssl.Provider());

//Set the host smtp address

Properties props = new Properties();

props.put("mail.transport.protocol", "smtp");

props.put("mail.smtp.starttls.enable","true");

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);

* Note the code is not mine, it is the result of many tryies and a copy of several fragments
found at google.. Thanks for all guys that drop these codes in the web. If you did the
original code, congratulations - I lost the link where I copied the original one and now I can
磘 give the credits to the original author , I just fixed some bugs and put it running up.

felipe_gauchoa | Tue, 10 Jul 2007 03:42:00 GMT |

I tried the above code but unfortunately it still didn't work for me.

Exception in thread "main" javax.mail.SendFailedException: Sending failed;

nested exception is:

javax.mail.MessagingException: 530 5.7.0 Must issue a STARTTLS command first


m1sm949464nzf

at javax.mail.Transport.send0(Transport.java:219)

at javax.mail.Transport.send(Transport.java:81)

at example.SendMailUsingAuthentication.postMail(SendMailUsingAuthentication.java:77)

at example.SendMailUsingAuthentication.main(SendMailUsingAuthentication.java:35)

cjmurphya | Tue, 10 Jul 2007 03:42:00 GMT |

Hello,

i have tried your code and i'm getting this exception:

Exception in thread "main" javax.mail.MessagingException: 454 TLS not available

due to temporary reason

at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1308)

at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:1168)

at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:33
0)

at javax.mail.Service.connect(Service.java:258)

at javax.mail.Service.connect(Service.java:137)

at javax.mail.Service.connect(Service.java:86)

at javax.mail.Transport.send0(Transport.java:150)

at javax.mail.Transport.send(Transport.java:80)

at br.com.bnb.mail.SendMailUsingAuthentication.postMail(SendMailUsingAut

hentication.java:88)

at br.com.bnb.mail.SendMailUsingAuthentication.main(SendMailUsingAuthent

ication.java:47)

this is the code i used:

/*

* Created on 14/09/2005

* TODO To change the template for this generated file go to

* Window - Preferences - Java - Code Style - Code Templates

*/

package br.com.bnb.mail;

import java.util.Properties;

import javax.mail.Authenticator;

import javax.mail.Message;

import javax.mail.MessagingException;

import javax.mail.PasswordAuthentication;
import javax.mail.Session;

import javax.mail.Transport;

import javax.mail.internet.InternetAddress;

import javax.mail.internet.MimeMessage;

/**

* ...author gaucho

* TODO To change the template for this generated type comment go to Window -

* Preferences - Java - Code Style - Code Templates

*/

public class SendMailUsingAuthentication {

private static final String SMTP_HOST_NAME = "gmail-smtp.l.google.com";

private static final String SMTP_AUTH_USER = "xxxxx...gmail.com";

private static final String SMTP_AUTH_PWD = "xxxxx";

private static final String emailMsgTxt = "Please visit my project at ";

private static final String emailSubjectTxt = "Order Confirmation Subject";

private static final String emailFromAddress = "xxxxx...gmail.com";

// Add List of Email address to who email needs to be sent to

private static final String[] emailList = { "xxxx...gmail.com" };

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;

java.security.Security

.addProvider(new com.sun.net.ssl.internal.ssl.Provider());

//Set the host smtp address

Properties props = new Properties();

props.put("mail.transport.protocol", "smtp");

props.put("mail.smtp.starttls.enable","true");

props.put("mail.smtp.host", SMTP_HOST_NAME);

props.put("mail.smtp.auth", "true");

Authenticator auth = new SMTPAuthenticator();

java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());

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 = new InternetAddress(recipients);

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);

can you please tell me what am i doing wrong?

thank you very much for your time.

gali_ba | Tue, 10 Jul 2007 03:42:00 GMT |

instead of using the Transport class use the com.sun.mail.smtp.SMTPSSLTransport class,


and pass it your session and a url of your server: here's an example:

Keep all your other code the same and add this where you are about to send your mail.

(i use the URLName construtor URLName(String, String, int, String, String, String).

URLName urln = new URLName("smtp", host, 587, "", USERNAME, PASSWORD);

com.sun.mail.smtp.SMTPSSLTransport trans = new


com.sun.mail.smtp.SMTPSSLTransport(session, urln);

trans.setStartTLS(true);

message.setSubject(subject);

message.setText(body);

trans.send(message);

trans.close();

This will work for you, it issues the SSL command first.

You need the newest mail.jar (version: javamail-1_3_3_01)

nizack05a | Tue, 10 Jul 2007 03:42:00 GMT |


Hello i had the same problem while attempting to send e-mail via smtp.gmail.com thru my
code ...plz any one help me in this aspect . my e-mail id isbrahmesh_vdp...yahoo.com

brahmesha | Tue, 10 Jul 2007 03:42:00 GMT |

This is an application that sends a message but there is a problem the domain could not
be resolved

/*

* Notifier.java

* Created on March 23, 2006, 11:22 AM

* To change this template, choose Tools | Options and locate the template under

* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.

*/

/**

* ...author Trainee

*/

import java.util.*;

import java.sql.*;

import javax.mail.*;

import javax.mail.internet.*;

import java.io.*;

import java.net.InetAddress;

import java.util.Properties;

import java.util.Date;

public class Notifier //throws MessagingException

public static void main(String args[]) //throws Exception

//SystemTray.getDefaultSystemTray().addTrayIcon(new TrayIcon(new
ImageIcon("imagefilename")));

// starts time getter

NotifierThread NThread = new NotifierThread();

Thread t = new Thread(NThread);

t.start();
//email module

//EmailThread emailThread = new EmailThread();

//emailThread.sendMessage();

/*SimpleSender simple = new SimpleSender();

simple.senderClassKo();*/

//String[] arrayKo = { "kikoyz_it...yahoo.com","def","xyz" };

//String[] arrayKo = { "keikun_naruchan...yahoo.com","def","xyz" };

//String recipients = "keikun_naruchan...yahoo.com";

/*EmailThread EThread = new EmailThread();

try

// ( String recipients[ ], String subject, String message , String from)

EThread.postMail( "johannazanza...yahoo.com" , "NOTIFY", "ContractOverdue" ,


"keikun_naruchan...yahoo.com");

System.out.println("ethread");

catch(MessagingException me)

me.printStackTrace();

}*/

//DBConnection dbc = new DBConnection();

//dbc.DBConnect();

/*

String host = "smtp.gmail.com";


String from = "vedi...gmail.com";

//String to = "keikun_naruchan...yahoo.com";

String to = "jitendra...gmail.com";

// Get system properties

Properties props = System.getProperties();

// Setup mail server

props.put("mail.smtp.host", host);

props.put("mail.smtp.starttls.enable", "true");

props.put("mail.smtp.auth", "true");

// Get session

Authenticator auth = new MyAuthenticator();

Session session = Session.getDefaultInstance(props, auth);

// Define message

MimeMessage message = new MimeMessage(session);

message.setFrom(new InternetAddress(from));

message.addRecipient(Message.RecipientType.TO,

new InternetAddress(to));

message.setSubject("Hello JavaMail");

message.setText("Welcome to JavaMail");

// Send message

//com.sun.mail.smtp.SMTPSSLTransport.send(message);

Transport.send(message);*/

}
}

class DBConnection

static String[] email2 = new String[10];

static int ctr = 0;

static String ctrlno = "";

public void DBConnect()

Connection connection = null;

Statement statement = null;

ResultSet rs = null;

try

Class.forName("org.postgresql.Driver");

connection = DriverManager.getConnection("jdbc:postgresql:cms", "postgres", "password");

statement = connection.createStatement();

String ctrlno2 = "ctrlno1";

String sql = "SELECT (expiredate - CURRENT_DATE) as no_days, cms_trans_contract.ctrlno,


cms_trans_contract_notify.notifyid, ofc_employee.email, notify1, notify2, notify3 from" +

" cms_trans_contract, cms_trans_contract_notify, ofc_employee where" +

" cms_trans_contract.ctrlno = cms_trans_contract_notify.ctrlno and


cms_trans_contract_notify.notifyid = ofc_employee.idnum";

//where ctrlno = " + "'"+ctrlno2+"'";

//"select expiredate from cms_trans_contract";

//wherer ctrlno = " + "'"+ctrlno2+"'";


//SELECT (CURRENT_DATE - expiredate) as no_days from cms_trans_contract

/*

sql += "where startdate between '";

sql += request.getParameter("commenceStartDate") + "' and '"

sql += request.getParameter("commenceEndDate") + "'";

sql += "and expiredate between '";

sql += request.getParameter("expireStartDate") + "' and '"

sql += request.getParameter("expireEndDate") + "'";

*/

rs = statement.executeQuery(sql);

//System.out.println("rs: " + rs.next());

while (rs.next())

//System.out.println("Record Found");

String firstname = "";

String lastname = "";

String notifyid = "";

String email = "";

int notify1;

int notify2;

int notify3;

//Date expiredate;

int subtracted_date;
//firstname = (rs.getString(1));

subtracted_date = (rs.getInt(1));

ctrlno = (rs.getString(2));

notifyid = (rs.getString(3));

//email = (rs.getString(4));

email2[ctr] = (rs.getString(4));

notify1 = (rs.getInt(5));

notify2 = (rs.getInt(6));

notify3 = (rs.getInt(7));

//lastname = (rs.getString(2));

//out.println(contract.getCtrlno());

//System.out.println("FIRSTNAME: " + firstname);

//System.out.println("LASTNAME: " + lastname);

//System.out.println("Expiredate: " + expiredate);

//System.out.println("Ctrlno: " + ctrlno);

System.out.println("SUB: " + subtracted_date);

//System.out.println("sql: " + sql);

if((((subtracted_date == notify1) || (subtracted_date == notify2)) || (subtracted_date ==


notify3)) && (subtracted_date > 0))

System.out.println("CtrlnoGET: " + ctrlno);

System.out.println("NotifyID: " + notifyid);

//System.out.println("email " + email);

System.out.println("EmailCTR: " + ctr +": " + email2[ctr]);


System.out.println("notify1: " + notify1);

System.out.println("notify2: " + notify2);

System.out.println("notify3: " + notify3);

EmailThread emailThread = new EmailThread();

emailThread.sendMessage(DBConnection.email2, DBConnection.ctrlno);

//ctr++;

ctr++;

if (rs.next() == false)

System.out.println("No records found");

catch (Exception ex)

ex.printStackTrace();

System.out.println("Error getting connections");

finally

try

if (rs != null)
{

rs.close();

if (statement != null)

statement.close();

if (connection != null)

connection.close();

catch (Exception ex)

ex.printStackTrace();

System.out.println("Error closing connections");

// time getter module

class NotifierThread implements Runnable

{
public void run()

while (true)

Calendar cal = new GregorianCalendar();

int hour12 = cal.get(Calendar.HOUR);// Range 0..11

//int hour24 = cal.get(Calendar.HOUR_OF_DAY);// Range 0..23

int min = cal.get(Calendar.MINUTE); // Range 0..59

int sec = cal.get(Calendar.SECOND); // Range 0..59

//int ms = cal.get(Calendar.MILLISECOND); // Range 0..999

int ampm = cal.get(Calendar.AM_PM); // Range 0=AM, 1=PM

String am_pm = "";

if(ampm == 0)

am_pm = "AM";

else

am_pm = "PM";

System.out.println("Time " + hour12 + ":" + min + ":" + sec + " " + am_pm);

if(sec == 10)

System.out.println("YIPEE");
//EmailThread emailThread = new EmailThread();

//emailThread.sendMessage(DBConnection.email2);

DBConnection dbc = new DBConnection();

dbc.DBConnect();

try

Thread.sleep(1000);

catch(Exception e)

e.printStackTrace();

class SimpleSender

/**

* Main method to send a message given on the command line.

*/

/*public void senderClassKo()

{
try

//String smtpServer="mail.kiksbalayon.com";

String smtpServer="localhost";

String to="johannazanza...yahoo.com";

String from="keikun_naruchan...yahoo.com";

String subject="hello";

String body="sa wakas ng send din";

send(smtpServer, to, from, subject, body);

catch (Exception ex)

//System.out.println("Usage: java com.lotontech.mail.SimpleSender"

//+" smtpServer toAddress fromAddress subjectText bodyText");

System.exit(0);

}*/

/*public static void send(String smtpServer, String to, String from, String subject, String
body)

try

Properties props = System.getProperties();

// -- Attaching to default Session, or we could start a new one --


props.put("mail.smtp.host", smtpServer);

Session session = Session.getDefaultInstance(props, null);

// -- Create a new message --

Message msg = new MimeMessage(session);

// -- Set the FROM and TO fields --

msg.setFrom(new InternetAddress(from));

msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));

// -- We could include CC recipients too --

// if (cc != null)

// msg.setRecipients(Message.RecipientType.CC

// ,InternetAddress.parse(cc, false));

// -- Set the subject and body text --

msg.setSubject(subject);

msg.setText(body);

// -- Set some other header information --

//msg.setHeader("X-Mailer", "LOTONtechEmail");

msg.setSentDate(new Date());

// -- Send the message --

Transport.send(msg);

System.out.println("Message sent OK.");

catch (Exception ex)

ex.printStackTrace();
}

}*/

//Authentication module

class MyAuthenticator extends Authenticator

MyAuthenticator()

super();

//protected PasswordAuthentication getPasswordAuthentication()

public PasswordAuthentication getPasswordAuthentication()

return new PasswordAuthentication("johann108", "password");

// email module

class EmailThread //throws MessagingException

public void sendMessage(String toEmail[], String ctrlno) //throws MessagingException

try

{
String host = "localhost";

//String host = "mail.philweb.com";

//String from = "johannazanza...yahoo.com";

String from = "johann108...lycos.com";

//String[] to = toEmail;

//"keikun_naruchan...yahoo.com";

// Get system properties

Properties props = System.getProperties();

// Setup mail server

props.put("mail.smtp.starttls.enable","true");

props.put("mail.smtp.host", host);

props.put("mail.smtp.auth", "true");

// Get session

Authenticator auth = new MyAuthenticator();

Session session = Session.getDefaultInstance(props, auth);

boolean debug = true;

session.setDebug(debug);

// Define message

MimeMessage message = new MimeMessage(session);

message.setFrom(new InternetAddress(from));

InternetAddress[] to = new InternetAddress[DBConnection.ctr];

for (int i = 0; i < DBConnection.ctr; i++)

to = new InternetAddress(toEmail);
//System.out.println("EMAILTO:" + to);

message.setRecipients(Message.RecipientType.TO, to);

//message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));

message.setSubject("Contract Expiry");

message.setText(

"Contract is about to expire\n" +

" ContractNumber is " + DBConnection.ctrlno

);

// Send message

Transport.send(message);

catch(Exception me)

me.printStackTrace();

System.out.println("Error in Sending Message");

keikun_naruchana | Tue, 10 Jul 2007 03:42:00 GMT |

> This is an application that sends a message but there

> is a problem the domain could not be resolved

What does that mean? Are you getting an exception with a message
of that sort? If so, it probably means your basic networking configuration

has a problem and it can't find the name of the host you're trying to connect to.

If this problem has nothing to do with the SMTPSendFailedException

that started this topic, this discussion should move to a new topic.

bshannona | Fri, 20 Jul 2007 06:41:00 GMT |

Pls check this conditions:

1)If TLS is required,set properity:

props.put("mail.smtp.starttls.enable","true");

If after this still doesn.t work., you should propably check if aren't running any processes in
your operating system, which scans outgoing mail (for example avast ). They can't support
TLS on port 25. So you have to turn this processes off.

Some servers can communicate via port 587, so if you add property

props.put("mail.smtp.port","587");

sometimes you get your mail application works fine together with scanners -)

2) You can use Telnet to determine what's wrong with sending mails and if connection is
encrypted..

Regards

dzonya | Fri, 20 Jul 2007 06:41:00 GMT |


You need latest 1.4 JavaMail, see the SSLNOTES..txt that comes in it. then set the property
mail.imap.starttls.enable or mail.smtp.starttls.enable to "true".also see
http://www.evolutionnext.com/blog/2006/01/11/1137030369151.htmlZhenlei Cai

zhenleicaia | Fri, 20 Jul 2007 06:41:00 GMT |


props.setProperty("mail.smtp.starttls.enable", "true");

f0rest_x87a | Fri, 20 Jul 2007 06:41:00 GMT |


props.setProperty("mail.smtp.starttls.enable", "true");

jprogramer | Tue, 12 Feb 2008 08:28:00 GMT |


Enterprise Technologies Related Links

Enterprise Technologies Hot Answers


* SMTP: Header lines in message body ?

Hi Seems I'm not the first to ask this question, but I didn't really find the answer to it, so
I'll post it again myself..When sending a mail using JavaMail SMTP I got some of the
header lines in the message body.How can this be avoided, or: what am I doing wrong ?Any
help would be highly ...
* SMTP without using Mail API

Dear all,I am attempting to write a simple mail program, without using the Java Mail
API.My code is as followsimport java.io.*;import java.net.*;import java.util.*;public class
Test{private String host_mailserver;private int port;private String recipient;private String
sender;private String ...
* SMTP Transport: SendFailedException

Currently, our company is in the implementation/testing stage of several servlets which


process sales from internet customers.One of a servlet's functions is to send a
"confirmation / thank you" email to the customer upon successful credit card verification
of purchase.Our "TransportMail" ...
* smtp server password

I have download de java mail example from sun, and I tryed to send a mail with a
picture. But I couldn't send the mail. I recived a mail that say that the smtp server did not
reach the recipient(s).One thing I want to ask is: Don't I need to put the password of the
smtp server? If yes, ...
* SMTP relay works with Thunderbird but not with Javamail

Hi all,I'm really clueless now and decided to ask for help here in this forum.I'm trying to
send a mail via an SMTP server which needs a login.I keep getting the error message
"javax.mail.SendFailedException: 554 <an_existing@mailaddress.de>: Relay access
denied"I read many postings in ...

Enterprise Technologies New questions

* zipoutputsteam and fileupload

Dear All,I'm badly hanging over here....with a stumbling block...in the progress......just, i
got blocked over here and dont know how to proceed further...the work i'm trying to do is:
have one client machine and a server machine... trying to upload a file from my client
machine to the server ...
* ZipFile closed: EJB Deployment Issue

Hi all,I am facing problems in the Ejb deployment. Please read the followingV r using
Weblogic 7.0 with jdk1.4Just take a luk at steps performed1. V compiled all the source
code, the ejbc compilation and the .ear generation thru ant(v 1.5) build scripts with
JDK1.4.12. When v tried deployin the ...
* ZipException
A new jaxb install and try to run the checkbook example from the docs. And I get:$ xjc
checkbook.dtd checkbook.xjsException in thread "main" java.util.zip.ZipException: The
system cannot find the path specifiedat java.util.zip.ZipFile.open(Native Method)at ...
* Zip help

How do we check if there are multiple files to unzip ?Is there a the method in the
java.util.zip that allow us to check for multiple files ? ...
* ZIP FILES

i'm interested in knowing how to zip and unzip files in java....can you help ...
* ZIP Compression

I've read some on this topic, but its still not clear to me.here's what I
got:try{FileOutputStream out = new FileOutputStream("zipFile.zip");zOut = new
ZipOutputStream(out);ZipEntry entry = new
ZipEntry("First");zOut.putNextEntry(entry);}catch(IOException e){}I build the Streams, but
where do ...
* your experiences with Websphere, Oracle OC4J and JRUN

I work for a county government and we are looking at J2EE servers. I want to do some
preliminary research and see what people seem to tthink about the three above
products.My background is Java training and no J2EE experience so I am going semi-blind
here except for the amount of reading I have ...
* Youden Graphs

Hello ,I require to create a youden Graph class. An applet would do good also as i have
to display this graph to my clients over the net .I was looking for a ready made class or a
pseudo code fr the same .Can any one help me ?Thank ...
* YACC vs Xalan

Hi, Is YACC an alternative to Xalan? If yes Could you please tell me which one is better
(easiest) to use with Xml and java.Thankssoumy ...
* Y is Stateless Session Bean is of type Session Bean?

Hi all!Statless Session Bean...It not maintaining a state ...then y its of type Session
Bean?...

Enterprise Technologies Related Categories

*
Desktop Technologies
*
Enterprise Technologies
*
Java Core APIs
*
Java Core GUI APIs
*
Java Database Connectivity (JDBC)
*
Java Development Tools
*
Java Enterprise java bean & Java EE (EJB)
*
Java Essentials
*
Java HotSpot Virtual Machine
*
Java in Newer
*
Java Intermediate
*
Java Miscellaneous
*
Java Open Source Software
*
Java Products
*
Java Professional Certification
*
Java Programming
*
Java Server Pages (JSP)
*
Java Socket Programming
*
Sun ONE Studio
*
Swing / AWT / SWT / JFace
*
Web & Directory & Servers & Security
*
Web Tier APIs

Site Links: iTags .NET Framework Java Programming Database MSDN Software Network
Email spam Ms Excel Visual Basic Visual C&C++ Microsoft XP Win NT/2k3 eMsdn eDevs
Law Support by Law Knowledge
About|Tags Directory|privacy|feedback|Submit your Website|Spam Report
©2010 THATSJAVA.COM. All rights reserved. - 0.1 - Last Modified: Sat, 20 Nov 2010
18:37:17 GMT
web stats counter

Das könnte Ihnen auch gefallen