thanks Mihai
I tried SMTP for simple text messages first
problem is, I am receiving the mails but message body is empty
here is the code:
sc = (SocketConnection)Connector.open("socket://"+smtpServerAddress+":25");
is = sc.openInputStream();
os = sc.openOutputStream();
os.write(("HELO there" + "\r\n").getBytes());
os.write(("MAIL FROM: "+ from +"\r\n").getBytes());
os.write(("RCPT TO: "+ to + "\r\n").getBytes());
os.write("DATA\r\n".getBytes());
// stamp the msg with date
os.write(("Date: " + new Date() + "\r\n").getBytes());
os.write(("From: "+from+"\r\n").getBytes());
os.write(("To: "+to+"\r\n").getBytes());
os.write(("Subject: "+subject+"\r\n").getBytes());
os.write((msg+"\r\n").getBytes()); // message body
os.write(".\r\n".getBytes());
os.write("QUIT\r\n".getBytes());
alpesh
hi Mihai
I did this and it's displaying the msg (before converting into bytes)
and also after converting msg into bytes i tried (msg+"\r\n").getBytes() and it displaying bytes means it is not null
also If I am sending mails to gmail or yahoo it gives me the error:
SMTP server response -
220 dnsconsultant (IMail 7.15 2462-1) NT-ESMTP Server X1
250 hello dnsconsultant
250 ok
550 not local host gmail.com, not a gateway
503 No recipient(s).
502 unimplemented command
502 unimplemented command
502 unimplemented command
502 unimplemented command
502 unimplemented command
502 unimplemented command
221 Closing connection. Good bye.
so if I want to send mails to/from any (yahoo, gmail and etc...) e-mail addresses what will be the smtpServerAddress
and is there any other configuraton needed?
alpesh
thanks
I got you guys
my question is:
If I want to send an Image to an email address from an email address
solution:
I think no other way other than using smtp and all configurations as you have mentioned
but dont you think this is quite complecated process for front-end j2me application?
what I am thinking is I do an Http push with parameters like
(i) to email,
(II) from email and
(III) data, which contains Bytes of Image
and my back-end application will send e-mail as what i want
is it possible and doable and efficient?
alpesh