I would suggest to go with Java transformation for emailing.
You just need add few lines and rest is default code from Java Transformation.
// Get system properties
Properties props = System.getProperties();
// Setup mail server
// Get session
Session session = Session.getDefaultInstance(props, null);
// Define message
MimeMessage message = new MimeMessage(session);
// Set the from address
// Set the to address
// Set the subject
BodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setText("If the attached file has any IsoCodes listed, those currencies were not updated in Sales Force. Note: If the file contains NO records, all applicable currencies are updated.");
Multipart multipart = new MimeMultipart();
messageBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource(FILE);
// Set the content
// Send message
} catch(Exception e)
Thanks for your reply.However sending an email is done by procedure itself and as per the procedure the email will be fired only when the loading is completed.But I am getting an email twice.
Looks like issue is with sp I would suggest to test that outside of Informatica first.
I dont want to use SP when I'm using specifically Informatica! Its great tool just need to know how to use it. if any other ETL tool then I may based on case. This is my opinion.
Ankit, are you absolutely sure that:
1. the SP is called nowhere else?
2. there is no email task, no pre- or post-session email, or whatever executed which may send the same mail twice?
In any case I would work with your network administrators; they should check the email configuration of the email server over which this email is distributed.
When I execute the procedure directly from the database,the mail gets fired only once.So I believe,the procedure has no issue.
The SP is called no where else.When I execute the procedure directly from the database,the mail gets fired only once.So I believe,the procedure has no issue.
Also we have other mappings where we have used email tasks.There the mails gets fired only once.There are no multiple mails.So I think email configuration on the server is correct.
But it might well be (depending on the configuration of the mail server) that this Stored Procedure when invoked via PowerCenter Stored Procedure transformation has some different properties for sending emails than when invoked in the DB.
Believe it or not, I have a similar problem with some antivirus vendor. For months now I get emails every now and then from them (after having re-registered for our company-wide anti-virus software). No problems. For two weeks now I see each email being sent to me twice. Without any apparent reason.
Email servers have bugs, too. So this might be an email server bug.
Again, I can only suggest that you ask your network administration (in particular those guys responsible for the email server) to double-check the email configuration and to run debug logs so that they may be able to verify whether it's a server setup or whatever.