[Gambas-user] smtp client
Steven Lobbezoo
steven at ...1652...
Tue Apr 24 12:12:05 CEST 2007
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
More information about the User
mailing list