[Gambas-user] smtp client

Benoit Minisini gambas at ...1...
Tue Apr 24 14:59:30 CEST 2007


On mardi 24 avril 2007, Steven Lobbezoo wrote:
> Hi,
>
> Advanced a bit on using it. The problem with To: was my own failure :-(
> (as usual)
> However, if i do :
>       Ema.Add(tmp, "text/pdf")
> where Ema is my smtp client,
> i get a signal 11, and the program aborts.
>
> In tmp is a pdf file of about 1.6 Mbyte. Is it to large ?
>
> Here is a bit of the code I used :
>
> PRIVATE SUB MailDoc(ddoc AS String)
> DIM tmp AS String
> DIM Ema AS SmtpClient
>
>   IF ToMails THEN
>   Ema = NEW SmtpClient
> ' we convert to pdf, and mail it
> ' you have to create a printer under cups, usr the ppd: ColorPostScript
> under generic printers
> '     printing to th uri : pipe:/bin/cat -
>
> > /user....home/request/var/tempfile.ps  <-- has to be world writable and
>
> exist !
>     SHELL "soffice -invisible -pt 'PostScript' '" & ddoc & "'" WAIT
>     ' now we pick up the file and convert it
>     SHELL "gs -q  -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite
> -sOutputFile='" & User.Home & "/request/work/tempfile.pdf' " &
>           "-dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false
> -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress " &
>           "-c save pop -f '" & User.Home & "/request/work/tempfile.ps'"
> WAIT ' we have the pdf (if all went well), lets send it to EMails (a list
> of email adresses)
>       Ema.To.Add("steven at ...1652...") '= ToMails
>       Ema.From = MGlobal.U_AgenNom & "<" & MGlobal.U_Mail & ">"
>       Ema.Subject = "Voici les données demandées sur le bien " & ME.Tag
>       Ema.Host = "revimmo.com"
>       tmp = file.Load(User.Home & "/request/work/tempfile.pdf")
>       Ema.Add(tmp, "text/pdf")              <---------- here is my sig 11 !
>       Ema.Send
>   END IF
>
>
> Any suggestions ?
>
> Steven
>

Yes. Send me the pdf file so that I try to send a mail with it and see where 
it crashes. 

Note that you can tell me where it crashes yourself by following the procedure 
explained in the troubleshooting section of the web site:

http://gambas.sourceforge.net/tr-report.html

Regards,

-- 
Benoit Minisini




More information about the User mailing list