通过vb6发送.xls附件文件显示outlook中的.dat文件 [英] Sending .xls attachment file through vb6 shows .dat file in outlook
问题描述
亲爱的先生
我使用带有excel附件的我的gmail帐户从vb 6发送邮件到我在Outlook的另一个帐户但是它显示了我的.xls.dat文件,在我发送的gmail项目中它也没有作为excel文件打开。
i我正在使用以下代码
设置mg = CreateObject(" CDO.Message")
设置iConf = CreateObject(" CDO.Configuration")
设置fn = iConf.Fields
schema =" http://schemas.microsoft.com/cdo/configuration/"
fn.Item(schema& " sendusing")= 2
fn.Item(schema&" smtpserver")= Text4.Text" smtp.gmail.com"
fn.Item(schema&" smtpserverport")= Text3.Text '25'465
fn.Item(schema&" smtpauthenticate")= 1 >
fn.Item(schema&" sendusername")="" &安培;修剪(Text1.Text)& "
fn.Item(schema&" sendpassword")="" &安培;修剪(Text2.Text)& "
含mg
.To = txtto
'.To ="" &安培; res(email)& "
.From =" <峰; br><" &安培;修剪(Text1.Text)& ">< br>"
.Subject =" Sub:Quotation为了提供以下规格的CARTONS:< br>"
FILELP1 =" D\file.xls"
。组织=" Duke Infosys
如果FILELP1<> ""那么
.AddAttachment"" &安培; FILELP1& "
结束如果
.ReplyTo ="" &安培;修剪(Text1.Text)& "
设置.Configuration = iConf
SendEmailGmail = .send
以
Dear Sir
I am sending mail from vb 6 using my gmail account with excel attached file to my another account in outlook but it shows my .xls.dat file and in my sent items of gmail it also not open as excel file.
i am using this following code
Set mg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set fn = iConf.Fields
schema = "http://schemas.microsoft.com/cdo/configuration/"
fn.Item(schema & "sendusing") = 2
fn.Item(schema & "smtpserver") = Text4.Text "smtp.gmail.com"
fn.Item(schema & "smtpserverport") = Text3.Text '25 ' 465
fn.Item(schema & "smtpauthenticate") = 1
fn.Item(schema & "sendusername") = "" & Trim(Text1.Text) & ""
fn.Item(schema & "sendpassword") = "" & Trim(Text2.Text) & ""
With mg
.To = txtto
'.To = "" & res("email") & ""
.From = " <br><" & Trim(Text1.Text) & "><br>"
.Subject = "Sub: Quotation For the supply of CARTONS with respect of following specification:<br>"
FILELP1 ="D\file.xls"
.Organization = "Duke Infosys"
If FILELP1 <> "" Then
.AddAttachment "" & FILELP1 & " "
End If
.ReplyTo = "" & Trim(Text1.Text) & ""
Set .Configuration = iConf
SendEmailGmail = .send
End With
推荐答案
D\file.xls
不是有效的文件名 - 将其更改为正确的文件名。
在尝试附加文件之前,还可以考虑使用Dir
确认文件存在
"D\file.xls"
is not a valid file name - change that to a proper file name.
Also consider usingDir
to confirm the file exists before trying to attach it
这篇关于通过vb6发送.xls附件文件显示outlook中的.dat文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!