Need help in setting SMTP server for sending mail ???
AnkitVSep 7 2011 — edited Sep 8 2011Hi
I have windows XP ver 2.18 and Oracle Database 10g Enterprise Edition Release 10.2.0.1.0.
I need to send mail from pl/sql using UTL_MAIL.
I came to know from reading that we need to set our machine as SMTP server first. So i did it via IIS in control panel.
Under Default SMTP Virtual server , i made a domain using alias option ( LOCAL domain), and tried setting it in Oracle via following command :
ALTER SYSTEM SET smtp_out_server='ANKIT-VOHRA.na.nisource.net' SCOPE=SPFILE;
SQL> shutdown immediate;
SQL> startup
SQL> show parameter smtp_out_server
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
smtp_out_server string ANKIT-VOHRA.na.nisource.net
SQL>
Now i tried sending mail :
BEGIN
UTL_MAIL.send(sender => 'me@nisource.net',
recipients => 'ankit.vohra1@gmail.com',
--cc => 'person3@domain.com',
--bcc => 'myboss@domain.com',
subject => 'UTL_MAIL Test',
message => 'If you get this message it worked!');
END;
I got following error :
Error report:
ORA-29279: SMTP permanent error: 550 5.7.1 Unable to relay for ankit.vohra1@gmail.com
ORA-06512: at "SYS.UTL_SMTP", line 21
ORA-06512: at "SYS.UTL_SMTP", line 99
ORA-06512: at "SYS.UTL_SMTP", line 241
ORA-06512: at "SYS.UTL_MAIL", line 424
ORA-06512: at "SYS.UTL_MAIL", line 594
ORA-06512: at line 2
29279. 00000 - "SMTP permanent error: %s"
*Cause: A SMTP permanent error occurred.
*Action: Correct the error and retry the SMTP operation.
I think that I did not set the server properly.
Can u please help me in setting the SMTP server properly and successfully sending mail !!