Home » SQL & PL/SQL » SQL & PL/SQL » Send mail from Gmail (merged by LF)  () 1 Vote
Send mail from Gmail (merged by LF) [message #251999] Tue, 17 July 2007 11:22 Go to next message
Rafeek
Messages: 159
Registered: April 2007
Location: egypt
Senior Member
hi all
how can i send email from my acounte in gamil by PL SQL?
thax
RAfeek

[Updated on: Tue, 17 July 2007 11:24]

Report message to a moderator

Re: send mail from gmail [message #252000 is a reply to message #251999] Tue, 17 July 2007 11:25 Go to previous messageGo to next message
BlackSwan
Messages: 25045
Registered: January 2009
Location: SoCal
Senior Member
You can't!
Re: send mail from gmail [message #252001 is a reply to message #251999] Tue, 17 July 2007 11:26 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
Sending e-mail from within Oracle
http://www.databasejournal.com/features/oracle/article.php/3423431

[Updated on: Tue, 17 July 2007 11:27]

Report message to a moderator

Re: send mail from gmail [message #252004 is a reply to message #252001] Tue, 17 July 2007 11:36 Go to previous messageGo to next message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
An old article.
Use UTL_MAIL now.

Regards
Michel
Re: send mail from gmail [message #252006 is a reply to message #252004] Tue, 17 July 2007 11:42 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
Only in 10g.
Re: send mail from gmail [message #252007 is a reply to message #251999] Tue, 17 July 2007 11:45 Go to previous messageGo to next message
BlackSwan
Messages: 25045
Registered: January 2009
Location: SoCal
Senior Member
Guys,
Yes one can send email from PL/SQL, but
>how can i send email from my acounte in gamil
AFAIK, you can't make it look like the message came from GMAIL or any other external MTA.
Re: send mail from gmail [message #252009 is a reply to message #252006] Tue, 17 July 2007 11:50 Go to previous messageGo to next message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
DreamzZ,
when no version is given, the last one is assumed.

Regards
Michel
Re: send mail from gmail [message #252011 is a reply to message #252007] Tue, 17 July 2007 11:56 Go to previous messageGo to next message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Ana,

I don't know for gmail but you can do it for any mail provider that let reach their smtp server from a mail program (thunderbird, outlook...).

Does gmail account only accessible via its webmail?

Regards
Michel
send mail from gmail [message #256436 is a reply to message #251999] Sat, 04 August 2007 13:25 Go to previous messageGo to next message
Rafeek
Messages: 159
Registered: April 2007
Location: egypt
Senior Member
hi
i use oracle database 10g and windows server 2003 .
how can i create function on database to send e-mail
from my gmail account (USE ssl).
thax
rafeek
Re: send mail from gmail [message #256438 is a reply to message #256436] Sat, 04 August 2007 13:30 Go to previous messageGo to next message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Same answer as in your previous same post:
http://www.orafaq.com/forum/m/251999/102589/?srch=send+mail#msg_251999

Regards
Michel
Re: send mail from gmail [message #256490 is a reply to message #256438] Sun, 05 August 2007 01:36 Go to previous messageGo to next message
Rafeek
Messages: 159
Registered: April 2007
Location: egypt
Senior Member
hi
thax for your message.
but i read this link .
gmail use ssl .
how can i use ssl connection .
thax
Rafeek
Re: send mail from gmail [message #256495 is a reply to message #256490] Sun, 05 August 2007 01:59 Go to previous messageGo to next message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
There is possible to use SSL, it is part of OAS (Oraccle Advanced Security) option.
Have a look at otn, there are papers on it.

Regards
Michel
Re: Send mail from Gmail (merged by LF) [message #256530 is a reply to message #251999] Sun, 05 August 2007 09:43 Go to previous messageGo to next message
BlackSwan
Messages: 25045
Registered: January 2009
Location: SoCal
Senior Member
>gmail use ssl .
Below from my current GMAIL connection
http://mail.google.com/mail/?auth=DQAAAHQAAAA64564874937877
Mine is NOT using https:

What problem are you really tryimg to solve?
Re: Send mail from Gmail (merged by LF) [message #256579 is a reply to message #256530] Mon, 06 August 2007 01:23 Go to previous messageGo to next message
Rafeek
Messages: 159
Registered: April 2007
Location: egypt
Senior Member
hi all
gmail support smtp server.
i use UTL_smtp package in 10g to send mail .
use UTL_smtp.connection to open connection with smtp server
and i use number of port .
how can i use this connection to setup ssl connection

thax
Rafeek
Re: Send mail from Gmail (merged by LF) [message #256593 is a reply to message #251999] Mon, 06 August 2007 01:39 Go to previous messageGo to next message
BlackSwan
Messages: 25045
Registered: January 2009
Location: SoCal
Senior Member
>gmail support smtp server.
I am sure it does.
>i use UTL_smtp package in 10g to send mail .
Good for you.
>use UTL_smtp.connection to open connection with smtp server>
>d i use number of port
if you insist.
>how can i use this connection to setup ssl connection
You are the one who insits you can do this.
Knock yourself up!
Re: Send mail from Gmail (merged by LF) [message #256597 is a reply to message #256579] Mon, 06 August 2007 01:44 Go to previous messageGo to next message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
how can i use this connection to setup ssl connection

You can't.

Regards
Michel
Re: Send mail from Gmail (merged by LF) [message #257517 is a reply to message #251999] Wed, 08 August 2007 09:22 Go to previous messageGo to next message
Rafeek
Messages: 159
Registered: April 2007
Location: egypt
Senior Member
iuse this code to send mail from smtp server not support ssl

DECLARE
c UTL_SMTP.CONNECTION;
rawname raw(100);
rawpass raw(100);

namevar varchar2(100);
passvar varchar2(100);


chrs varchar2(1024):='nbjk';
raws raw(100);
PROCEDURE send_header(name IN VARCHAR2, header IN VARCHAR2) AS
BEGIN
UTL_SMTP.WRITE_DATA(c, name || ': ' || header || UTL_TCP.CRLF);
END;
BEGIN
c := UTL_SMTP.OPEN_CONNECTION('smtp-server');


utl_smtp.command(c, 'AUTH LOGIN');

rawname:=utl_i18n.string_to_raw('mail');
rawpass:=utl_i18n.string_to_raw('password');

rawname:=UTL_ENCODE.BASE64_ENCODE(rawname);
rawpass:=UTL_ENCODE.BASE64_ENCODE(rawpass);

namevar:=UTL_I18N.RAW_TO_CHAR(rawname );
passvar:=UTL_I18N.RAW_TO_CHAR(rawpass );


--UTL_ENCODE.BASE64_ENCODE


utl_smtp.command(c, namevar);
utl_smtp.command(c, passvar);


-- utl_smtp.command(c, demo_base64.encode(utl_raw.cast_to_raw(your mail)));
-- utl_smtp.command(c, demo_base64.encode(utl_raw.cast_to_raw(passwoed)));


raws:=utl_i18n.string_to_raw(chrs);
chrs := utl_i18n.raw_to_char(raws, 'AR8ISO8859P6');

chrs:=UTL_ENCODE.TEXT_DECODE('Here is some text','AR8ARABICMACS',UTL_ENCODE.BASE64);


UTL_SMTP.MAIL(c, mail);
UTL_SMTP.RCPT(c, mail);
UTL_SMTP.OPEN_DATA(c);
send_header('From', '"Sender" mail');
send_header('To', '"Recipient" mail');
send_header('Subject', 'Hello' || chrs);
UTL_SMTP.WRITE_DATA(c, UTL_TCP.CRLF || 'Hello, world!');
UTL_SMTP.CLOSE_DATA(c);
UTL_SMTP.QUIT(c);
EXCEPTION
WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
BEGIN
UTL_SMTP.QUIT(c);
EXCEPTION
WHEN UTL_SMTP.TRANSIENT_ERROR OR UTL_SMTP.PERMANENT_ERROR THEN
NULL;
END;
raise_application_error(-20000,
'Failed to send mail due to the following error: ' || sqlerrm);
END;
Razz
Re: Send mail from Gmail (merged by LF) [message #257527 is a reply to message #257517] Wed, 08 August 2007 10:02 Go to previous message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What is this? A code you copy from where? Is this using SSL?

In addition,
Please read and follow How to format your posts
Make sure that lines of code do not exceed 80 or 100 characters when you format.

Regards
Michel
Previous Topic: sql query
Next Topic: Database link
Goto Forum:
  


Current Time: Wed Dec 07 08:45:38 CST 2016

Total time taken to generate the page: 0.27673 seconds