on 02-20-2014 7:46 AM
Dear Experts,
I am using PI 7.31 (single stack) with AAE. Please can you let me know if I can use the mail adapter to send an e-mail without any attachment.
At present, we have 2 options: XIALL and XIPAYLOAD, and in both options mail adapter sends the payload and/or soap message.
The requirement is just to send a (notification) mail without any attachment.
Kind Regards,
MM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Murli
By default the mail adapter does not send the data as attachment. You have to choose the option 'keep attachment' in the mail adapter to send payload data as attachment.
So use option 'XIPAYLOAD' and do not check the 'keep attachment' option. In this case the payload of the PI message will be sent as the content of the email but not as attachment.
Dear Indrajit,
Nice to see you here.
I have tried all these optons. The 'keep attachment' is unchecked, and I am getting the payload attachment in email. The actual requirement is to get a mail notification without attachment, without the payload in mail body. Just a mail with subject.
Is this possible?
Check below article where u can find the parameters using which u can send content as mail body
(BTW, if i am not wrong i have already shared this wiki in ur previous post, but it seems that u haven't checked it properly?)
Thanks
Amit Srivastava
Hello,
Tell me one thing, the attachment which is coming in mail adapter is the source message becoz u are doing pass through scenario just for sending notification? right?
I think u can write a custom AM which will suppress the message which is getting transferred to receiver mail adapter + in mail adapter hardcode subject/maild id etc. and then check?
Code:
package com.test;
import java.rmi.RemoteException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.ejb.EJBException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import com.sap.aii.af.lib.mp.module.ModuleContext;
import com.sap.aii.af.lib.mp.module.ModuleData;
import com.sap.aii.af.lib.mp.module.ModuleException;
import com.sap.aii.af.service.auditlog.Audit;
import com.sap.engine.interfaces.messaging.api.Message;
import com.sap.engine.interfaces.messaging.api.MessageKey;
import com.sap.engine.interfaces.messaging.api.MessagePropertyKey;
import com.sap.engine.interfaces.messaging.api.Payload;
import com.sap.engine.interfaces.messaging.api.XMLPayload;
import com.sap.engine.interfaces.messaging.api.auditlog.AuditLogStatus;
/**
* @author amitsrivastava5
*
*/
public class TestBean implements SessionBean {
/* (non-Javadoc)
* @see javax.ejb.SessionBean#ejbActivate()
*/
@Override
public void ejbActivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see javax.ejb.SessionBean#ejbPassivate()
*/
@Override
public void ejbPassivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see javax.ejb.SessionBean#ejbRemove()
*/
@Override
public void ejbRemove() throws EJBException, RemoteException {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
*/
@Override
public void setSessionContext(SessionContext arg0) throws EJBException,
RemoteException {
// TODO Auto-generated method stub
}
public void ejbCreate() throws javax.ejb.CreateException {
}
public ModuleData process(ModuleContext mc, ModuleData inputModuleData)
throws ModuleException {
Object obj = null;
Message msg = null;
MessageKey key = null;
String FileName = "";
MessagePropertyKey FileKey = null;
try {
obj = inputModuleData.getPrincipalData();
msg = (Message) obj;
key = new MessageKey(msg.getMessageId(), msg.getMessageDirection());
// Returns the main document as XMLPayload.
XMLPayload xpld = msg.getDocument();
byte[] b = "".getBytes();
xpld.setContent(b);
// Sets the principle data that represents usually the message to be processed
inputModuleData.setPrincipalData(msg);
}catch (Exception e) {
Audit.addAuditLogEntry(key, AuditLogStatus.SUCCESS, "Module Exception caught:");
ModuleException me = new ModuleException(e);
throw me;
}
return inputModuleData;
}
}
Thanks
Amit Srivastava
Hi Murli,
Yes you can send the mail without attachment .
Regards
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.