oracle mail utl_smtp
DECLARE
c utl_smtp.connection;
PROCEDURE send_header(name IN VARCHAR2, header IN VARCHAR2) AS
BEGIN
utl_smtp.write_data(c, name || ': ' || header || utl_tcp.CRLF);
END;
BEGIN
-- << 用你的SMTP伺服器地址替換 'smtp.xxx.com'
c := utl_smtp.open_connection('smtp.xxx.com');
-- << 用你的使用者名稱替換user1, 密碼替換pass
-- << 用你的SMTP伺服器地址替換 'smtp.xxx.com'
utl_smtp.helo(c, 'smtp.xxx.com');
utl_smtp.command(c, 'AUTH LOGIN');
utl_smtp.command(c, utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw('user'))));
utl_smtp.command(c, utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw('password'))));
-- << 用你的email地址替換
utl_smtp.mail(c, );
-- << 用收信人的email地址替換
utl_smtp.rcpt(c, );
utl_smtp.open_data(c);
send_header('From', 'send_header('To', '
utl_smtp.write_data(c, utl_tcp.CRLF || 'Hello, microsoft, I like oracle not sql server :-)');
utl_smtp.close_data(c);
utl_smtp.quit(c);
END;
utl_smtp.write_raw_data(c, utl_raw.cast_to_raw(
convert( 'Subject:'||v_email_title|| utl_tcp.CRLF ,'ZHS16GBK') ) ); --寫標題
utl_smtp.write_raw_data(c, utl_raw.cast_to_raw(
convert(utl_tcp.CRLF || v_email_content ,'ZHS16GBK') )); --寫正文
send_header('Content-type','text/plain; charset=utf-8');
send_header('Content-type','text/html; charset=utf-8');
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/59792/viewspace-893493/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle send mailOracleAI
- [Developer] Oracle send mail procedure(2)DeveloperOracleAI
- 利用UTL_SMTP傳送郵件
- mailAI
- You have new mail in /var/spool/mail/rootAI
- Send MailAI
- mail with attachmentAI
- Mail To SyntaxAI
- System.Net.Mail和System.Web.MailAIWeb
- [Shell] Monitor other host oracle instance alert.log and mailOracleAI
- Oracle UTL_MAIL郵件包程式使用實踐OracleAI
- ORACLE 8I 中使用 pl/sql(utl_smtp) 傳送郵件的一些體會OracleSQL
- 9.Monitor other host oracle instance alert.log and mailOracleAI
- ORACLE mail傳送功能,增加使用者驗證功能OracleAI
- [Shell] 自動生成oracle awr report並mail出來OracleAI
- 利用ORACLE utl_stmp 包實現 mail傳送功能OracleAI
- [Linux] mutt mail oracle awr [Html能正常顯示錶格]LinuxAIOracleHTML
- Others_2_MailAI
- 6.12.MailAI
- drupal7 mailAI
- awr 自動mailAI
- utl_mail packageAIPackage
- 163mailAI
- centos 老出現You have new mail in /var/spool/mail/root 解決CentOSAI
- 去掉linux中"You have new mail in /var/spool/mail/root"的提示LinuxAI
- nagios mail告警通知iOSAI
- django send_mail功能DjangoAI
- [shell] execute remote Script自動生成oracle awr report並mail出來REMOracleAI
- Jbpm3.2 傳送郵件需要修改org.jbpm.mail.Mail類AI
- 利用spring-mail 寫的超級smart-mail傳送器SpringAI
- golang mail、shell、cookie、uuidGolangAICookieUI
- PEM (Privacy Enhanced Mail) EncodingAIEncoding
- com.sun.mail.smtp DescriptionAI
- mail can't send title on SolarisAI
- Flask 外掛系列 - Flask-MailFlaskAI
- C# mail pop3 clientC#AIclient
- 《web-Mail服務的搭建》WebAI
- 利用msmtp+mutt 傳送mailAI