一个关于发自动发邮件的程序解决思路

一个关于发自动发邮件的程序
我在写一个用SMTP协议发送邮件的程序,可是编译通过后总是出现问题。下面是源代码,是我在网上看到的,可是不知道为什么就是运行不了。

#include<windows.h>
#include<iostream>
#include<stdlib.h>

using std::string;
using std::cout;
//#pragma comment(lib,"icePubDll.lib");

int main()
{
typedef int (WINAPI ICEPUB_SENDMAILTEXT)(char *strUsername,char *strPassword,char *strSmtpServer,char *sendMail,char *toMailList,char *strSubject,char *strText);
ICEPUB_SENDMAILTEXT *icePub_sendMailText=NULL;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_sendMailText = (ICEPUB_SENDMAILTEXT *)GetProcAddress(hDLLDrv, "icePub_sendMailText");
}
char * strUsername={"123456"};
char * strPassword={"abcdefg"};
char * strSmtpServer={"smtp.qq.com"};
char * sendMail={"abcdefg@qq.com"};
char * toMailList={"zxcvb@tom.com"};
    char * strSubject={"标题:还好么?"};
    char * strText={"文本:扉心祈梦,梦语问春天。"};
    if(icePub_sendMailText)
icePub_sendMailText(strUsername,strPassword,strSmtpServer,sendMail,toMailList,strSubject,strText);
    if(hDLLDrv)
  FreeLibrary(hDLLDrv); 
return 0;

}


我已经换上了正确的密码还有号码,但是还是出现这个问题一个关于发自动发邮件的程序解决思路

我单步调试发现在调用 icePub_sendMailText函数时出现了这个问题
一个关于发自动发邮件的程序解决思路

求大神帮忙解决下,我觉得可能是指针的问题,但是这个程序本来就是从网上找的,不知道是我VC的问题还是说还有地方可以改下。在线等啊。
邮件 调试 指针 SMTP

------解决方案--------------------
引用:
Quote: 引用:

icePub_sendMailText 获取到的函数指针是多少?
dll加载到的地址是0x10000000,  icePub_sendMailText获取到的函数指针是0x100185B6.

你编译的进程是32位的吗,这个dll可能不兼容,要不就是你的入参有问题了。
------解决方案--------------------
看看源码分析一下,说不定有收获吧。
------解决方案--------------------
有DLL源码没,没还不如另外找个,smtp的东西比较简单网上一搜一大把。。。