Dear sanvaibhav, I have a job requirement in which i have to take email ids from the excel sheet and send the email notification to that email ids. excel sheet is containing list of email ids. Regards, Csah
I am able to generate the log file of the talend job but when i am executing the .bat (Standalone execution) then i am not able to generate the log file..
Regards,
Csah
I think you are missing something...
Have you checked the validation for directory creation... directory is not created because it does not exists...
java.io.File log_folder = new java.io.File(System.getProperty("user.dir")+"/_logs1/");
if (!log_folder.exists())
{
if (log_folder.mkdir())
{
//System.out.println("Directory is created!");
}
else
{
//System.out.println("Failed to create directory!");
}
}
java.io.File logFile = new java.io.File(System.getProperty("user.dir")+"/_logs1/"+projectName+".log");
java.io.PrintStream ps = new java.io.PrintStream(new java.io.FileOutputStream(logFile));
System.setOut(ps);
System.setErr(ps);
This works... I tested again for your.
Thanks
Vaibhav
Every thing is working fine...
Now i have one more requirement let support i want the log of the failed email ids means that email id in which the notification mail has not sent by the job due to any reason..
tSendMail would send mail for every mail ID. Mail server sends the mail, but it may turn out to be not delivered due to mail ID problem. This returned mail is available in Inbox.
You can write another job to read the mails from this mailbox using tpop and check for failure mails.
Another way could be to use OnSubJobError for tSendMail, you can get the error generated for particular mail ID.
Vaibhav
Whether you are able to connect to the mail server using IP. Usually the mail server is like smtp.mail.com...
Whether SSL configuration is required for your mail serve?
Check your mail server settings..
Refer to
https://help.talend.com/search/all?query=tSendMail&content-lang=en Vaibhav