是否可以在VFP写的程序中实现E-MAIL的发送功能,大致的代码是如何实现的,谢谢!!
PS:我用的是VFP6
------解决方案--------------------------------------------------------
在VFP中发送电子邮件
* 声明ShellExecute函数
DECLARE INTEGER ShellExecute IN shell32.DLL INTEGER HWND,;
STRING lpszOP, ;
STRING lpszFile, ;
STRING lpszParams, ;
STRING lpszDir, ;
INTEGER fsshowcmd
* 声明GetDesktopWindow函数,该函数激活Windows桌面
DECLARE INTEGER GetDesktopWindow IN win32api
* 指定从Windows桌面上运行ShellExecute函数
HWND = GetDesktopWindow()
lpszOP = " "
* 指定ShellExecute操作的文件为mailto: qyjohn@letterbox.com
lpszFile = "mailto: qyjohn@letterbox.com "
lpszParams = " "
* 指定ShellExecute的缺省目录为C:\
lpszDir = "C:\ "
fsshowcmd = 1
* 执行ShellExecute命令
LNRETURN = ShellExecute(HWND, lpszOP, lpszFile, lpszParams, lpszDir,fsshowcmd)
*-------------------------------------------
DECLARE INTEGER ShellExecute IN shell32.DLL ;
INTEGER hndWin, STRING cAction, STRING cFileName,;
STRING cParams, STRING cDir, INTEGER nShowWin
M.EMAIL= 'SUNYA@126.com '
LcMail= "mailto: "+M.EMAIL+ "?Subject=請購單確認,請簽核 "+ "&Body= "+;
"您好! ";
+CHR(10)+CHR(13)+ " PQ2006300158: "+ '未確認,請及時確認並簽核,謝謝!! ';
+CHR(10)+CHR(13)+ ' '+ '王小虎 ';
+CHR(10)+CHR(13)+ ' '+DTOC(DATE())
ShellExecute(0, "open ",LcMail, " ", " ",1)