cancel
Showing results for 
Search instead for 
Did you mean: 

Sending mails thru EP

prasenjit_sharma
Active Contributor
0 Kudos

Hi Forum,

I am trying to configure the functionality using which we can send emails from EP. Is there a way by which we can achieve this without using groupware? Actually we have an SMTP server and port available, using which we can send mails from SAP GUI. But when it comes to EP I don't know how do we configure in the system. Is there a step by step guide to achive this? Also let us know what are the roles we need to assign to the users for the send mail option will be visible for them. We are giving minimum required access to the users.

Any help will be appreciated and points guarranted.

Regards,

- Prasenjit

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Sharma,

I would like to know where u want to configure your email service. I mean whether it's in your portal component or groupware integration under Collaboration.

prasenjit_sharma
Active Contributor
0 Kudos

Hi,

I want to configure my e-mail service in EP. I am not presently looking at the groupware integration part. What I need to know is where can I find the option to send mails. Do I need to create an iView for this? Or there is an existing functionality available? Do I need to add some specific roles to my user to be able to see this option?

Regards,

- Prasenjit

achim_hauck2
Active Contributor
0 Kudos

first, you have to configure your mail-transport as linked in my post above.

then, you can send email for example within the "collaboration"-package (depends on your portal-release) from KMC (KMC can be installed optionally in your portal)

kr, achim

Former Member
0 Kudos

Hi Sharma,

I am sending a sample code, probably this will helps you in your situation

public class mailtest {

ResourceBundle bundle = null;

// String status = "";

String username = "";

String password = "";

String host = "";

Session session;

SMTPTransport ser;

Transport tr;

java.util.Properties props;

boolean process = false;

Store sto;

synchronized public boolean sendMail(String aToAddress,String aFromAddress, String aMailMessage,String aSubject) throws Exception{

boolean status = false;

try {

if (aSubject == null)

aSubject = "Null";

if (aMailMessage == null)

aMailMessage = "No message";

try

{

System.out.println(host);

props = System.getProperties();

InetAddress in = InetAddress.getByName(host);

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

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

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

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

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

session =

Session.getInstance(props, new javax.mail.Authenticator() {

protected javax

.mail

.PasswordAuthentication getPasswordAuthentication() {

return new javax.mail.PasswordAuthentication(

username,

password);

}

});

session.setDebug(true);

MimeMessage message = new MimeMessage(session);

// Address fromAddress = new InternetAddress("xyz@xyz.com");

Address fromAddress = new InternetAddress(aFromAddress);

message.setFrom(fromAddress);

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

// MimeBodyPart mbp = new MimeBodyPart();

// mbp.setText(aMailMessage);

message.setSubject(aSubject);

message.setText(aMailMessage);

message.saveChanges();

Transport transport = session.getTransport("smtp");

transport.connect(host,25,username,password);

Transport.send(message);

transport.close();

status = true;

} catch (Exception ex) {

throw new Exception(ex);

}

}catch(Exception eex){

throw new Exception(eex);

}

return status;

}

public static void main(String[] args) {

mailtest test = new mailtest();

try {

test.sendMail("abc@abc.com","xyz@xyz.com","Test mail","Test mail");

System.out.println("mail sent");

} catch (Exception e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

Former Member
0 Kudos

Hi Prasenjit,

Try this <a href="https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1770">weblog</a>.

Regards,

Pooja.

achim_hauck2
Active Contributor
0 Kudos

Prasenjit,

a SMTP-server is enough, this should help you: http://help.sap.com/saphelp_nw2004s/helpdata/en/7c/6a469702474146a8ef2f97fe880b2f/frameset.htm

kr, achim