Unable to send mail with different fonts and colors

Hi All,here is the explanation for my problem:I am sending mail using javamail. when i send the text with different font and color its not received in the same way. it is simply sending as plain text.Please help me on this issue.ThanksNG
[279 byte] By [JavaBaby@79a] at [2007-11-27 1:33:47]
# 1
Be sure to read the JavaMail FAQ and the sample programs that come with JavaMail.Are you sending text/html messages?
bshannona at 2007-7-12 0:40:20 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Yeah,I am sending text/html messges only.
JavaBaby@79a at 2007-7-12 0:40:20 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

Ok, the first step is to make sure you're sending what you think you're sending.

After your call to Transport.send, add

msg.writeTo(newFileOutputStream("msg.txt"));

If you don't know how to read a raw MIME message, post it here.

If msg.txt contains the correct message, compare it with the message that's

received by the recipient. Use the "view message source" option in the mail

reader.

If they're the same, then either the message content isn't actually correct for

what you're trying to do, or the mail reader is ignoring your html "suggestions"

and displaying the message however it wants.

bshannona at 2007-7-12 0:40:20 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

Hello,

I am trying to develop an email application. It consists on sending email from email1@domain.com to email2@email.com

How can I do this in java ?

I am using this software but it works only with gmail !!

/**

* Send Email to the webmaster

*/

String d_email = "email1@gmail.com",

d_host = "smtp.gmail.com",

d_port = "465",

m_to = "email2@yahoo.com",

m_subject = "Email from user";

Properties props = new Properties();

props.put("mail.smtp.user", d_email);

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

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

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

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

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

props.put("mail.smtp.socketFactory.port", d_port);

props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");

props.put("mail.smtp.socketFactory.fallback", "false");

SecurityManager security = System.getSecurityManager();

try

{

Authenticator auth = new SMTPAuthenticator();

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

//session.setDebug(true);

MimeMessage msg = new MimeMessage(session);

msg.setText("This is a message from: "+UserEmail+"\n "+UserMessage);

msg.setSubject(m_subject);

msg.setFrom(new InternetAddress(d_email));

msg.setSentDate(new Date());

msg.addRecipient(Message.RecipientType.TO, new InternetAddress(m_to));

Transport.send(msg);

}

catch (Exception ex)

{

ex.printStackTrace();

out.println("Messaging ERROR: " + ex);

out.println(stack2string(ex));

if(ex.getMessage().compareTo("")!=0)

check = "Message NOT SENT " + ex.getMessage();

}

private class SMTPAuthenticator extends javax.mail.Authenticator

{

public PasswordAuthentication getPasswordAuthentication()

{

return

new PasswordAuthentication("email1@gmail.com", "pwd");

}

}

please advice

haifa_tl@yahoo.coma at 2007-7-12 0:40:20 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5

I'm not sure which part you're confused about but I'm guessing that there's

something basic about how internet email works that you're not understanding.

In all cases, you need a mail server to give your message to. The mail server

will then take responsibility for routing the message to the correct destination

mail server. The gmail mail server works fine for this, assuming you have a

gmail account.

Gmail probably won't let you falsify the From address for your message so if

you want to send mail that appears to come from some address other than

your gmail account, you'll probably need to use a mail server associated with

the account you want the mail to appear to come from. If you run your own

mail server, you can decide whether it will allow senders to falsify the From

address.

bshannona at 2007-7-12 0:40:20 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 6
Please advice How can I do it. which mail server may I use instead of gmail ?
haifa_tl@yahoo.coma at 2007-7-12 0:40:20 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 7
Please read the JavaMail FAQ.If the company you work for doesn't provide one, and your Internet Service Providerdoesn't provide one, you're probably out of luck.
bshannona at 2007-7-12 0:40:20 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...