Delphi MapiSendMail 在 Windows 7 64 位上崩溃
我有 Windows 7 64 位,当我尝试第二次发送电子邮件或者有时甚至只是等待第一次发送邮件完成时,我的 delphi sendmail 崩溃了。相同的应用程序适用于 Windows Vista。
以下是我发送邮件的测试过程:
procedure TForm1.SendMail(const Subject, FileName: String);
var tmpName2, PFullFilePath, PSubject : Array[0..MAX_PATH] of AnsiChar;
MapiMessage : TMapiMessage;
MapiFileDesc : TMapiFileDesc;
MError : Cardinal;
begin
with MapiFileDesc do
begin
ulReserved:=0;
flFlags:=0;
nPosition:=Cardinal(-1);
StrPCopy(PFullFilePath, FileName);
lpszPathName:=PFullFilePath;
StrPCopy(tmpName2,ExtractFileName(FileName));
lpszFileName:=tmpName2;
lpFileType:=nil;
end;
with MapiMessage do
begin
ulReserved := 0;
StrPCopy(PSubject, Subject);
lpszSubject := PSubject;
lpszNoteText := nil;
lpszMessageType := nil;
lpszDateReceived := nil;
lpszConversationID := nil;
flFlags := 0;
lpOriginator := nil;
nRecipCount := 0;
lpRecips := nil;
nFileCount := 1;
lpFiles := @MapiFileDesc;
end;
MError:=MapiSendMail(0,Application.Handle, MapiMessage, MAPI_DIALOG or MAPI_LOGON_UI or MAPI_NEW_SESSION, 0);
if MError<>0 then
Raise Exception.CreateFmt(IntToStr(MError), [MError]);
end;
我收到的错误/崩溃消息:
问题签名:
问题事件名称:APPPCRASH
应用程序名称:mapitestp.exe
应用程序版本:0.0.0.0
应用程序时间戳:4d82c905
故障模块名称:ntdll.dll
故障模块版本:6.1.7600.16559
故障模块时间戳:4ba9b29c
异常代码:4000001f
异常偏移:000a1dcf 操作系统版本:6.1.7600.2.0.0.256.1
区域设置 ID:1033
附加信息1:d1ab
附加信息2:d1ab624ec7d094c26a73530c245a3468
附加信息3:d1ab
附加信息4:d1ab624ec7d094c26a73530c245a3468
任何帮助或想法将非常感激。谢谢
I have windows 7 64-bit and my delphi sendmail crashes when trying to send an email for the second time or sometimes even just waiting for the first send mail to complete. Same application works with windows vista.
Below is my test procedure in sending the mail:
procedure TForm1.SendMail(const Subject, FileName: String);
var tmpName2, PFullFilePath, PSubject : Array[0..MAX_PATH] of AnsiChar;
MapiMessage : TMapiMessage;
MapiFileDesc : TMapiFileDesc;
MError : Cardinal;
begin
with MapiFileDesc do
begin
ulReserved:=0;
flFlags:=0;
nPosition:=Cardinal(-1);
StrPCopy(PFullFilePath, FileName);
lpszPathName:=PFullFilePath;
StrPCopy(tmpName2,ExtractFileName(FileName));
lpszFileName:=tmpName2;
lpFileType:=nil;
end;
with MapiMessage do
begin
ulReserved := 0;
StrPCopy(PSubject, Subject);
lpszSubject := PSubject;
lpszNoteText := nil;
lpszMessageType := nil;
lpszDateReceived := nil;
lpszConversationID := nil;
flFlags := 0;
lpOriginator := nil;
nRecipCount := 0;
lpRecips := nil;
nFileCount := 1;
lpFiles := @MapiFileDesc;
end;
MError:=MapiSendMail(0,Application.Handle, MapiMessage, MAPI_DIALOG or MAPI_LOGON_UI or MAPI_NEW_SESSION, 0);
if MError<>0 then
Raise Exception.CreateFmt(IntToStr(MError), [MError]);
end;
Error/Crash Message that I get:
Problem signature:
Problem Event Name: APPCRASH
Application Name: mapitestp.exe
Application Version: 0.0.0.0
Application Timestamp: 4d82c905
Fault Module Name: ntdll.dll
Fault Module Version: 6.1.7600.16559
Fault Module Timestamp: 4ba9b29c
Exception Code: 4000001f
Exception Offset: 000a1dcf
OS Version: 6.1.7600.2.0.0.256.1
Locale ID: 1033
Additional Information 1: d1ab
Additional Information 2: d1ab624ec7d094c26a73530c245a3468
Additional Information 3: d1ab
Additional Information 4: d1ab624ec7d094c26a73530c245a3468
Any help or idea would be very much appreciated. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看 Embarcadero 的链接,这可能是一些 Unicode 问题。
希望对您有帮助。
Take a look at this Link at Embarcadero, it may be some Unicode issue.
Hope it helps you.