Sending component replacement in Oracle
Last Update:2018-12-07
Source: Internet
Author: User
Create Or Replace Procedure Send_mail (
Pemail In Varchar2 ,
PPW In Varchar2 ,
PID In Varchar2
)
Is
Rochelle mailhost Varchar2 ( 64 ): = ' IP ' ;
Rochelle from Varchar2 ( 64 ): = 'Account @ email domain name ' ;
L_subject Varchar2 ( 64 ): = ' Title ' ;
Rochelle Varchar2 ( 64 ): = Pemail;
Rochelle mail_conn utl_smtp.connection;
Begin
-- Rochelle mail_conn: = utl_smtp.open_connection (Rochelle mailhost, 25 );
-- Utl_smtp.helo (l_mail_conn, l_mailhost );
-- Open SMTP connection
Rochelle mail_conn: = Utl_smtp.open_connection (l_mailhost, Port );
Utl_smtp.ehlo (l_mail_conn, l_mailhost );
Utl_smtp.command (l_mail_conn, ' Xxxx ' );
Utl_smtp.command
(L_mail_conn,
Utl_raw.cast_to_varchar2
(Utl_encode.base64_encode (utl_raw.cast_to_raw ( 'Xxx ' )
)
)
);
Utl_smtp.command
(L_mail_conn,
Utl_raw.cast_to_varchar2
(Utl_encode.base64_encode (utl_raw.cast_to_raw ( ' Xxxx ' )
);
utl_smtp.mail (l_mail_conn, l_from );
utl_smtp.rcpt (l_mail_conn, l_to);
utl_smtp.open_data (l_mail_conn);
utl_smtp.write_data (l_mail_conn,
' Date: '
| To_char (sysdate, ' DD-MON-YYYY hh24: MI: Ss. ' )
| CHR ( 13 )
);
Utl_smtp.write_data (l_mail_conn, ' From: ' | Rochelle from | CHR ( 13 ));
Utl_smtp.write_data (l_mail_conn, ' Subject: ' | L_subject | CHR ( 13 ));
Utl_smtp.write_data (l_mail_conn, ' To: ' | Rochelle | CHR ( 13 ));
Utl_smtp.write_data (l_mail_conn, '' | CHR ( 13 ));
Utl_smtp.write_data (l_mail_conn, ' Dear sir ' | CHR ( 13 ));
Utl_smtp.write_data (l_mail_conn, '' | CHR ( 13 ));
Utl_smtp.write_data (l_mail_conn,
' Your acount is created '
| PID
| ' And password is '
| PPW
| CHR ( 13 )
);
Utl_smtp.write_data
(L_mail_conn,
' Xxxx '
| CHR ( 13 )
);
Utl_smtp.write_data
(L_mail_conn,
' Xxx '
| CHR ( 13 )
);
Utl_smtp.write_data (l_mail_conn,
' Http: // ip address to log in. ' | CHR ( 13 )
);
Utl_smtp.write_data
(L_mail_conn,
' Xxxx '
| CHR ( 13 )
);
Utl_smtp.write_data (l_mail_conn, ' What you can do. ' | CHR ( 13 ));
Utl_smtp.write_data (l_mail_conn,
' Xxx ' | CHR ( 13 )
);
Utl_smtp.write_data (l_mail_conn, '' | CHR ( 13 ));
Utl_smtp.write_data (l_mail_conn, ' Sincerely ' | CHR ( 13 ));
Utl_smtp.write_data (l_mail_conn, ' ' | CHR ( 13 ));
Utl_smtp.write_data (l_mail_conn,
' From xxxx ' | CHR ( 13 )
);
Utl_smtp.close_data (l_mail_conn );
Utl_smtp.quit (l_mail_conn );
End ;