[Gambas-user] Send Mail In Gambas

johnf jfabiani at ...1109...
Wed Jan 11 19:40:22 CET 2006


On Wednesday 11 January 2006 10:05, Rob Kudla wrote:
> On Wed January 11 2006 12:37, SHARMAQ Sistemas wrote:
> > How to i can send a Relat by email in Gambas?
>
> A couple of ways.  You can connect to an SMTP server directly and
> just send the mail using SMTP commands:
>
> dim s as new Socket
> s.Host = "my.mail.server.com.br"
> s.Port = 25
> s.Connect
>
> and in the Socket_Ready sub, something like this:
> dim s as Socket
> s = LAST
> print #s, "HELO myhostname.mydomain.com.br\r\n"
> print #s, "MAIL FROM:<my at ...1320...>\r\n"
> print #s, "RCPT TO:<their at ...1320...>\r\n"
> print #s, "DATA\r\n"
> print #s, "Subject: Test Mail From Gambas\r\n"
> print #s, "Date: Wed, 11 Jan 2006 15:37:07 -0200\r\n"
> print #s, "From: my at ...1320...\r\n"
> print #s, "To: their at ...1320...\r\n"
> print #s, "\r\n"
> print #s, "This is the body of the message.\r\n"
> print #s, "\r\n"
> print #s, ".\r\n"
> close s
>
> Or you can check for the existence of the "sendmail" program in
> your user's path, and shell out to that.  That's probably the
> easier way, but in my experience, a sendmail-compatible program
> isn't installed by default on most Linux distributions anymore.
>
> Rob
I'm really glad you provided that info because my solution depended on a dcop 
app running.  
John




More information about the User mailing list