在winnt/win9x下用blat發email的示例(轉)
在winnt/win9x下用blat發email的示例(轉)[@more@]## 步驟:## A.安裝blat.# 1.下載blat .( )# 2. 解壓到一個目錄,如 e:usrbinblat## B.除錯本程式.# ### 配置信件內容 ##$blat_prog="e:usrinlatlat.exe"; #指定blat.exe路徑$server="smtp.263.net";$from="sirbowl@263.net";$to="sirbo@263.net";$subject="hi,this is sent from blat.exe !";$body="this is body!!!!";###### 配置完成 ########$file=""; #一般為空$temp_files_path="."; #一般為空##############($errcode,$output) = &mail_blat($blat_prog, $server, $from, $to, $subject, $file, $body, $temp_files_path);&htmlhead;print " errcode is $errcodeoutput is $output";exit;#########################sub htmlhead{local($temp1)=$_[0];if($has_send != 1){if($temp1 eq "admin"){print "Content-type: text/htmln";print "Pragma:no-cachenn";}else{print "Content-type: text/htmlnn";}$has_send=1;}}######### 以下一段是庫檔案的函式說明#=====================================================================## Sending mail with Blat (Win 95/NT)## Blat home page: ## Can send file or text or file+text (if both $file and $body ne "")## Call as:# ($errcode,$output)=# &mail_blat($blat_prog, $server, $from, $to,# $subject, $file, $body, $temp_files_path);## Returns error-code(correct in Blat 1.5 only) and Blat-output## Author : Mike Blazer blazer@mail.nevalink.ru# Version: 1.4 Last Modified: Jan 7, 1998# Tested : on ActiveWare's Perl port, build 110; Win'95, Win NT+IIS 3.0#=====================================================================sub mail_blat {local ($blat_prog, $SMTP_host, $from, $to, $subj,$file, $body, $temp_files_path) = @_;local ($temp_file, $out, $filebody);if (!$body){return 4,"Both body/file sources are empty in " .__FILE__." at line ".__LINE__."n" if !$file;$temp_file=$file;}else { # create temp-file's nameBEGIN{ srand $$.time }do {$temp_file = "$temp_files_path/".int (rand(1000000)).".file"} until (!-e $temp_file);# file+body requestif ($file) {open (IN,"$file") ||return 1,"Can not read file $file in " .__FILE__." at line ".__LINE__."n";$filebody = join "",;close IN;}# write message's body to temp-fileopen (TEMP, ">$temp_file") ||return 2,"Can not write temp-file $file in " .__FILE__." at line ".__LINE__."n";print TEMP "$filebodyn$body";close TEMP;} # end of else$out=`$blat_prog $temp_file -s "$subj" -f $from -t $to -server$SMTP_host`;# remove temp-fileunlink $temp_file if ($temp_file ne $file);# workaround syntax error that returns 0$? = 3 if(!$? && $out=~/nsyntax:n/);# return error-code and Blat-outputreturn $?,$out;}
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8225414/viewspace-942997/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 用C++Builder在WINNT下編制一個Service (轉)C++UI
- 用PHP編寫email群發器 (轉)PHPAI
- 怎 樣 在APPLET 中 發EMAIL (轉)APPAI
- 用oracle發emailOracleAI
- 怎樣在APPLET中發EMAIL javamail (轉)APPAIJava
- Win9x下程式間的資料傳遞 (轉)
- Win9x下虛擬光碟機的檢測 (轉)
- WinNT&Win2K下實現程式的完全隱藏(轉)
- 一個不錯的發郵件工具blat
- Delphi發emailAI
- linux下傳送email的c語言程式碼(轉)LinuxAIC語言
- XML 在 ASP 環境下的應用(轉)XML
- Oracle在Linux下的C開發(轉)OracleLinux
- 在 Linux 下 9 個有用的 touch 命令示例Linux
- Direct Show 開發的一個示例 (轉)
- 在InstallShield中引用WINSOCK 的示例 (轉)
- 判斷字串是否是合法的EMail (轉)字串AI
- Python實現TCP/IP協議下的埠轉發及重定向示例PythonTCP協議
- .NET環境下Email的技術介紹AI
- 從outlook匯入email地址 (轉)AI
- Docker 下開發 hyperf 完整使用示例Docker
- 在Linux系統下FTP的配置與應用(轉)LinuxFTP
- ServletOutputStream在nginx轉發下輸出檔案下載的一種方法ServletNginx
- 用shell指令碼傳送帶附件的email指令碼AI
- 在windows下開發go 用什麼工具WindowsGo
- 用C++Builder 5開發Windows下的屏保 (轉)C++UIWindows
- 函式索引的兩個應用場景示例(下)函式索引
- 常用Email元件傳送函式 (轉)AI元件函式
- VC在windows下編寫用於序列通訊的程式 (轉)Windows
- 【VS】_WIN32_WINNT not definedWin32
- 大家注意了:不要留自己的email地址在論壇AI
- 構件技術在MIS開發中的應用(轉)
- noVNC在Windows下的應用VNCWindows
- Linux 下 cut 命令的 4 個基礎實用的示例Linux
- 在Unix系統下用shell製作通用介面(轉)
- 在Linux下用DMA方式傳輸資料(轉)Linux
- 用linux下的php3發E-MAIL (轉)LinuxPHPAI
- 物件導向的方法在遊戲中的應用的一個例子(下)(轉)物件遊戲