Focal Point
[SOLVED] edamail works with PDF but not in excel, get a blank sheet

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9177061136

May 30, 2013, 04:29 PM
paulux99
[SOLVED] edamail works with PDF but not in excel, get a blank sheet
I have set up my stmp server and the coding below for PDF works fine and I get an output in pdf. However somehow when I use and open the excel option, I get a blank sheet every time with no records.

TABLE FILE CAR
PRINT *
IF RECORDLIMIT IS 10
ON TABLE HOLD AS MAIL_FILE FORMAT EXCEL
-*ON TABLE HOLD AS MAIL_FILE FORMAT PDF
END

-RUN
EX EDAMAIL email.com,,test,A,EXCEL,MAIL_FILE
-*EX EDAMAIL email.com,,test,A,PDF,MAIL_FILE

This message has been edited. Last edited by: <Kathryn Henning>,
May 31, 2013, 09:05 AM
dhagen
It is a bug and it has been reported and, to the best of my knowledge, it is being worked on. You should open a case anyway so that you can be added to the "notification of fix" list.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
May 31, 2013, 11:52 AM
paulux99
Thanks for letting me know this is a known bug.
June 03, 2013, 09:56 AM
Edwin
You need to use XHT and in windows explorer Tools -> Folder Options -> File Types, change XHT default Safari to open with Microsoft Excel.
June 04, 2013, 08:46 AM
paulux99
For time being, I am using XHT along with XL2K but hopefully then Ibi can come up with a fix/update where EXCEL format can be used. thanks.
June 18, 2013, 11:00 AM
linnex
Hi,

if you are running a Windows Server (with .NET and powershell installed) + you are allowed to use -DOS commands you could also try the following:

 
-SET &TMPPATH = TEMPPATH(255,'A255');
-SET &TMPPATH = TRUNCATE(&TMPPATH);

TABLE FILE CAR
PRINT *
ON TABLE HOLD AS HTMP FORMAT EXCEL
END
-RUN

-SET &ATTACHMENT_FILENAME = &TMPPATH || 'htmp.xls';
 
   
-SET &SMTP_SERVER = '<enter your smtp server here>';
-SET &SENDER ='<enter your sender mail-addr here>';
-SET &RECEIVER ='<enter your receiver mail-addr here>';
-SET &SUBJECT = 'A test mail';
-SET &HTML_BODY = '<html><body><h3>This is a nice test mail</h3></body></html>';
-TYPE powershell "$SmtpClient = new-object system.net.mail.smtpClient('&SMTP_SERVER|'); $MailMessage = New-Object system.net.mail.mailmessage; $att = new-object Net.Mail.Attachment('&ATTACHMENT_FILENAME|'); $mailmessage.Attachments.Add($att); $mailmessage.from = '&SENDER|'; $mailmessage.To.add('&RECEIVER|'); $mailmessage.Subject = '&SUBJECT|'; $MailMessage.IsBodyHtml = $true; $mailmessage.Body = '&HTML_BODY|'; $smtpclient.Timeout = 30000; $smtpclient.Send($mailmessage);"
-DOS powershell "$SmtpClient = new-object system.net.mail.smtpClient('&SMTP_SERVER|'); $MailMessage = New-Object system.net.mail.mailmessage; $att = new-object Net.Mail.Attachment('&ATTACHMENT_FILENAME|'); $mailmessage.Attachments.Add($att); $mailmessage.from = '&SENDER|'; $mailmessage.To.add('&RECEIVER|'); $mailmessage.Subject = '&SUBJECT|'; $MailMessage.IsBodyHtml = $true; $mailmessage.Body = '&HTML_BODY|'; $smtpclient.Timeout = 30000; $smtpclient.Send($mailmessage);"
 


The advantage using powershell or an external software for mailing compared to edamail:

multiple attachments (use "$att = new-object Net.Mail.Attachment" multiple times) and nicely formated html mails (not only ref. lines)


WebFOCUS 7.7.03
June 18, 2013, 11:33 AM
paulux99
Hello,
thanks for your suggestion, unfortunately I am on a solaris environment. If anyone knows of a similar suggestion for Solaris as linnex did, this would be greatly appreciated.
June 18, 2013, 12:52 PM
linnex
Hi again,

while I do not know the linux / unix equivalent exactly, you could have a look at "mutt" (www.mutt.org). From what I can see it should be able to perform the same stuff on solaris.

cheers Linne


WebFOCUS 7.7.03