Question: java mail send using setText()

Ads

 
 
 

Share on Google+Share on Google+

Thadeuse
java mail send using setText()
0 Answer(s)      3 years and 10 months ago
Posted in : JavaMail

Hai , Am newly mail send portion in java , Here i write my code ,

final String userName = "[email protected]";
        final String password = "xxx xx xxx";
        Properties properties = new Properties();
        properties.put("mail.smtp.auth", "true");
        properties.put("mail.smtp.starttls.enable", "true");
        properties.put("mail.smtp.host", "smtp.gmail.com");
        properties.put("mail.smtp.port", 587);
        Session session = Session.getInstance(properties,
                new javax.mail.Authenticator()
                {
                    @Override
                    protected PasswordAuthentication getPasswordAuthentication()
                    {
                        return new PasswordAuthentication(userName, password);
                    }
                });
        MimeMessage message = new MimeMessage(session);
        message.setFrom(new InternetAddress("[email protected]"));
        message.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));

        message.setSubject("mail testing");
        message.setText("<html><head><title>java blog.fr<title></head><body>Java Blog.fr / Java.lu - Java Development and Tools</body></html>");
        Transport.send(message);

Here am using set Text() method to send mail content in html format. if i use set Text() method mail content is display same structure what i wrote the code in java file . but if i use set Content() method, mail content is display html format is right. I want to use set Text() method to send mail in html format . any one help

Ads
View Answers
Ads









Related Tutorials/Questions & Answers:
Tutorials   
Java Spring Hibernate Struts Training program paradigams program paradigams program paradigams automatically resend when connection lost in sending email automatically resend when connection lost in sending email automatically resend when connection lost in sending email java mail send using setText() how to send message java code to send email using gmail smtp server Sending email with read and delivery requests values of the "from address & to addresses" while sending a mail to localhost using javamail projects Autodownload email attachments Reading the body of mail excluding the signature how to send contact detail in email problem in viewing the mail's content using javamail how to send mail with multiple attachments in jsp Core java Exception in thread java mail java mail API sending mail using jsp attendance management system source code Multiplication table code for sending email using j2me audio video conferencing Java Email automate mails in lotus notes java mail sending with images Code for opening a new mail from the default mail box and copy the database contents Sending Emails In Java Sending Emails In Java Sending Emails In Java sending email using smtp in java java mail programs How to send sms alerts to mobile using java? get from address using javamail api? mail java How can java programs execute automatically when it connects to network I want complete tutorial on advanced java email java result after compilation TEST JAMES MAIL SERVER i need a help in this please javamail help in java help in java Request URl using Retrive data from dtabase

Ads

 
Advertisement null

Ads