Olá,

Em 22 de março de 2010 10:33, José Antônio (YMAIL) <[email protected]>escreveu:

> Pessoal estou com dificuldades com enviar e-mail via banco,
>
> Ele executa, retorna mensagem de erro e para o servidor postgres.
>
>
>
> ----------------------------------------------------------------------------
> ------------------------------------------------
>
> ----------------------------------------------------------------------------
> ------------------------------------------------
> -- Function: checkordermail()
>
> -- DROP FUNCTION checkordermail();
>
> CREATE OR REPLACE FUNCTION __teste_email()
>  RETURNS integer AS
> $BODY$
> DECLARE textMessage text;
> BEGIN
>        textMessage := 'Thank you for paying your bill.  How sweet of you.
>                I love cake.  Dont you?';
>        perform pgmail('e-mail_remetente', '[email protected]','You paid.
> How nice.', textMessage);
>        return 1;
> END;
>
> $BODY$
>  LANGUAGE 'plpgsql' VOLATILE
>  COST 100;
>
>
> ----------------------------------------------------------------------------
> ------------------------------------------------
>
> ----------------------------------------------------------------------------
> ------------------------------------------------
>
> -- Function: pgmail(text, text, text, text)
>
> -- DROP FUNCTION pgmail(text, text, text, text);
>
> CREATE OR REPLACE FUNCTION pgmail(text, text, text, text)
>  RETURNS integer AS
> $BODY$
>
> package require smtp
> package require mime
>
> set nomeusuario         $1
> set mailto              $2
> set mailmessage         $4
> set mailsubject         $3
> set senhausuario        ""
> set ServidorSMTP        ""
> set port 587
> set token [mime::initialize -canonical text/plain -string $mailmessage]
>    mime::setheader $token Subject $mailsubject
>    smtp::sendmessage $token -recipients $mailto -servers $ServidorSMTP
> -username $nomeusuario -password &senhausuario
>    mime::finalize $token
>
> return 1
>
>
> $BODY$
>  LANGUAGE 'pltclu' VOLATILE
>  COST 100;
> ALTER FUNCTION pgmail(text, text, text, text) OWNER TO postgres;
>

Qual o erro que dá?



>
> _______________________________________________
> pgbr-geral mailing list
> [email protected]
> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>


[]s
-- 
JotaComm
http://jotacomm.wordpress.com
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a