on 04-11-2006 6:27 AM
Hi all,
any one knows how to send email using SMTP from webdynpro application to Outlook. Please reply.
Thank you
Maruthi
Hi
Make sure you maintain you java mail client settings in Visual Admin
use the following code example to send mail messages
Properties props = new Properties();
props.put("domain", "true");
Context initialContext = new InitialContext(props);
Session sess = (Session) initialContext.lookup("java:comp/env/mail/MailSession");
Session mailSession = Session.getDefaultInstance(sess.getProperties());
Transport transport = mailSession.getTransport("smtp");
//MimeMessage message = new MimeMessage(sess);
MimeMessage message = new MimeMessage(mailSession);
message.setSubject("Your ERP Portal Certificate");
message.setFrom(new InternetAddress("portal@portal.com"));
message.addRecipient(javax.mail.Message.RecipientType.TO, new InternetAddress(userArr.getEmail()));
//
// This HTML mail have to 2 part, the BODY and the embedded image
//
MimeMultipart multipart = new MimeMultipart("related");
// first part (the html)
BodyPart messageBodyPart = new MimeBodyPart();
String htmlText ="Dear ERP user , </b>" ; messageBodyPart.setContent(htmlText, "text/html");
// add it
multipart.addBodyPart(messageBodyPart);
// put everything together
message.setContent(multipart);
transport.connect();
transport.sendMessage(message, message.getRecipients(javax.mail.Message.RecipientType.TO));
transport.close();
proxy.gotoPage("umHelpPage");
uidUserCreatteLog(userArr.getEmail());
}
Theo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maruti,
Check your NetWeaver IDE installation: there is a directory "examples" (at the same level where eclipse.exe located) and one tutorial covers sending JavaMail (both tutorial text and sample project should be there).
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.