导航:首页 > 源码编译 > mfcoutlook源码

mfcoutlook源码

发布时间:2022-09-23 03:32:02

1. OUTLOOK怎么发HTML代码的邮件

提供一个思路,首先你可以做一个能通过url正常访问的html网页,注意html中的地址一定要加上带域名的绝对地址,然后把这个html的源码放到outlook中,进行修改后发送就可以了

2. outlook vba发邮件问题

仔细看了一下,原来的代码的确有些问题,这个是我现在用的,我一次只能发不超过15封邮件,否则邮件网关(单位自有邮件服务器)会阻止我。延迟发送是我加的,没有测试。

我下面的代码是在如下情况下使用(很有必要说清楚)。

就我自用来说。

首先,我有一个excel文件,其中存放的是的待发送人员的姓名以及邮件地址。

其次,我会将网络断开,使用word的邮件功能,并使用上述excel中的邮件地址,合并,并批量生成邮件。

之后,因为网络断开,本来要通过outlook发送的邮件,都会因为发送失败出现在发件箱中。出于方便操作和手动控制发送节奏的目的,将发件箱中所有发送失败的邮件拷贝到草稿箱。

最后,重新连接网络,使用上述代码手动一次发个10封左右的邮件,我是发一次歇一会。发送邮件通过vba添加附件。(你所要求的延迟,是我临时加的,没有经过测试)如果加了延迟,你可以修改vba中,一次复制到发件箱邮件的个数,控制时间间隔。(也可以一次复制完毕,我出于测试的目的,第一次通常会用程序从草稿箱移动2个邮件发送,然后检查看有无错误,以免错误过大难以控制)

希望对你有帮助,附现在用的代码。

Option Explicit
'将草稿箱中的邮件发送出去
Const strAttachmentPath = "" '附件路径E:\办公\科研处\国家基金要点提示\2014自然基金模板及简明指南摘要.rar
Const intMailCount = 10 '单次发送邮件数
Sub subSendEmail()

'On Error Resume Next
Dim fld_OutBox AsOutlook.MAPIFolder
Dim objItems As Outlook.Items
Dim myItem As Object
Dim myItems() As Object
Dim iIndex As Integer '延迟技术器
Dim intervalMinute As Integer '延迟分钟数
Dim objMail As Outlook.MailItem
iIndex = 1
Dim n As Integer
If MsgBox("附件:" &strAttachmentPath & vbCrLf & "单次发送邮件数:" & intMailCount & vbCrLf & "以上信息正确与否?", vbOKCancel) <> vbOK Then
Exit Sub
End If

'获得发件箱
Set fld_OutBox = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderOutbox)
Set objItems = fld_OutBox.Items

If fld_OutBox.Items.Count = 0 Then
'如果发件箱邮件数为0从草稿箱中移动邮件
'从草稿箱中移动若干邮件到发件箱
funMoveMailToOutBox intMailCount
End If

'如果发件箱存在对象,对其中的邮件执行发送
If objItems.Count > 0 Then
For Each objMail In objItems
If (objMail.Class = 43) Then
'发送邮件
If (strAttachmentPath <>"") Then
'存在附件路径,添加附件
objMail.Attachments.AddTrim(strAttachmentPath), olByValue, 1
End If

'延迟发送
'iIndex = iIndex + 1
'objMail.DeferredDeliveryTime =DateAdd("n", iIndex * intervalMinute, Now)

objMail.Send

End If
Next
End If
End Sub

Function funMoveMailToOutBox(ByVal numEmailAs Integer) As Boolean
'移动numEmail指定的邮件数从draft到outBox
'On Error Resume Next
Dim fld_OutBox AsOutlook.MAPIFolder
Dim fld_Drafts AsOutlook.MAPIFolder

Dim objItemsDrafts AsOutlook.Items
Dim objMail As Outlook.MailItem
Dim n As Integer
n= 0
'获得发件箱对象
Set fld_OutBox =Application.GetNamespace("MAPI").GetDefaultFolder(olFolderOutbox)

'获得草稿箱对象
Set fld_Drafts =Application.GetNamespace("MAPI").GetDefaultFolder(olFolderDrafts)
Set objItemsDrafts = fld_Drafts.Items

'按照numEmail指定的数值移动邮件
While (objItemsDrafts.Count > 0) And (n < numEmail)
'如果草稿箱不为空
Set fld_Drafts =Application.GetNamespace("MAPI").GetDefaultFolder(olFolderDrafts)
Set objItemsDrafts = fld_Drafts.Items
Set objMail = objItemsDrafts.GetFirst()
If (objMail.Class = 43) Then
objMail.Move fld_OutBox
Else
Exit Function
End If
n = n + 1

Wend
End Function

3. 如何将表单提交到指定的邮箱中(不是OUTLOOK).望给源码.

<form action="mailto:[email protected]" encType="text/plain" method=post>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#ffffff">
<td height="20">户 籍</td>
<td height="20"><input type="text" name="vcha_hukouaddress" value="" style="width:150px" maxlength="500"></td>
<td height="20">手机号码</td>
<td height="20"><input type="text" name="vcha_movetel" value="" style="width:100px" maxlength="250"></td>
<td height="20">宅 电</td>
<td height="20"><input type="text" name="vcha_tel" value="" style="width:100px" maxlength="50"></td>
</tr>
<tr bgcolor="#ffffff">
<td height="20">现住地址</td>
<td height="20"><input type="text" name="vcha_zhuadd" value="" style="width:250px" maxlength="500"></td>
<td height="20">E_Mail</td>
<td height="20"><input type="text" name="vcha_email" value="" style="width:150px" maxlength="250"></td>
<td height="20">上传照片</td>
<td height="20"><input type="text" name="upfilepath" maxlength="39" style="width:100px" value="">
<input type="button" name="mybutton" value="选择" onClick="fileupload()"></td>
</tr>
</table></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#ffffff">
<td align="center"><input type="submit" onClick="SendMail()" value="提交">

<input type="button" value="关闭" onClick="window.close();">
</td>
</tr>
</table></td>
</tr>
</table>
</form>

4. outlook 2007编辑html邮件内容时怎么不能看源代码

不会~~

5. 有没有能使用Excel调用OUTLOOK或者Foxmail发邮件的工具,源代码也行,也就是VBA的。

其实Excel文件菜单里有选项可以直接把文档发送Email,不过调用的是Windows默认内嵌的OutLookExpress程序。

6. mfc如何在原有代码中加入Offic风格的界面

实际上,Ribbon界面(Office 2007风格的界面)的开发早在2008年就随着Visual C++ Feature Pack被引入到Visual Studio 2008中。在即将到来的Visual Studio 2010中,Ribbon界面的开发更是得到了原生的支持,使得Ribbon界面的开发更加简便高效。
首先,我们启动Visual Studio 2010,创建一个基于MFC的应用程序,项目模板我们选择“MFC Application”

在接下来的“MFC应用程序向导”中,我们就可以对项目的可视化风格进行选择和配置。Visual Studio 2010支持MFC风格、标准的Windows风格,Visual Studio 2005风格和Office 2007风格。而这里的Office 2007风格,就是我们要创建的Ribbon界面。

在接下来的向导页中,我们可以选择命令栏(工具栏。菜单栏)的样式,这里我们当然选择“Use a ribbon”了。当然,为了跟旧有的系统保持兼容,Visual Studio 2010也支持传统的命令式界面,如果你的用户比较保守,想继续使用传统的菜单式界面,我们可以选择“Use a menu bar and toolbar”

为了支持丰富的Office 2007界面风格,MFC默认情况下为MFC文档应用程序添加了类似Outlook风格的导航面板(Navigation pane)和标题条(Caption bar)。这两者并不是我们关注的重点,为了更好的展示Ribbon界面,我们这里就去掉这两个多余的面板。

到这里,针对新项目的设置就完成了,点击“Finish”按钮关闭应用程序向导,Visual Studio 2010就会按照我们的设置创建相应的MFC应用程序解决方案。编译运行这个解决方案,我们就得到了第一个具有Ribbon界面的应用程序。

7. 如何用c++获取outlook里的邮件

// dbx_EnsureFolders: first builds up a FolderSorting tree. Then calls
// the above function to it into the flat global vector.
//
void dbx_EnsureFolders(const string name,const string ver)
{ string testn=name, testv=ver;
if (testn=="") testn="_"; if (testv=="") testv="_";
if (dbx_DoneFoldersName==testn && dbx_DoneFoldersVer==testv) return;
dbx_DoneFoldersName=testn; dbx_DoneFoldersVer=testv;
dbx_Folders.clear();
if (dbx_DoneStores=="") dbx_EnsureStores(name);
//
// Now let's find the path for this name/ver
string path="";
for (vector<TDbxStore>::iterator i=dbx_Stores.begin(); i!=dbx_Stores.end(); i++)
{ if (name=="" && ver=="") {path=i->path; break;}
else if (name==i->name && ver==i->ver) {path=i->path; break;}
}
if (path=="") return;
string ffn = path+"\\Folders.dbx";
if (!FileExists(ffn)) return;

// Folders.dbx is an index of the folders in this profile.
// It is a flat list. Each entry has:
// id, parent-id, fn, name, regstring, subindex, value, id0b
// The id/parent-id determine the structure of the tree
// name is the folder name, and fn is the dbx filename (as a sub of path)
// For top-level ones, we look at regstring to determine the index:
// "LocalStore" is 1, some others also have numbers, some are empty (in which case we use index in the file)
// For sub-level ones, some have subindex set, some are empty (in which case we use index in the file)
// If value is 1, or if id0b is 0x2F0000, then this might be an offlineable folder.
vector<TDbxFolderSorting*> folders;
map<unsigned int,TDbxFolderSorting*> i2f;
//
// I'm using my specialised memory-mapped class here.
// Arne's code was written to use an istream instead, so you'll
// have to either change this to an istream, or change Arne's code.
imemfile inm(ffn.c_str());
if (!inm.okay()) return;
DbxFileHeader fileHeader(inm);

const int4 treeNumber=2; // This third tree stores pointers to all folder informations
int4 address = fileHeader.GetValue(fhTreeRootNodePtr+treeNumber);
int4 entries = fileHeader.GetValue(fhEntries +treeNumber);
if(address && entries)
{ DbxTree tree(inm,address,entries); // Read in the tree with all pointers
for(int4 filepos=0; filepos<entries; ++filepos)
{ int1 *ptr; int4 length;
address = tree.GetValue(filepos); // Get the address of the folder info
DbxFolderInfo folderInfo(inm,address); // Read in the folder info
unsigned int index = folderInfo.GetValue(0);
unsigned int pindex = folderInfo.GetValue(1);
string fn; ptr=folderInfo.GetValue(3,&length); if (ptr!=0 && length>0) fn=string((char*)ptr,length-1);
string name; ptr=folderInfo.GetValue(2,&length); if (ptr!=0 && length>0) name=string((char*)ptr,length-1);
string reg; ptr=folderInfo.GetValue(5,&length); if (ptr!=0 && length>0) reg=string((char*)ptr,length-1);
unsigned int pos = folderInfo.GetValue(9);
unsigned int value = folderInfo.GetValue(10);
unsigned int id0b = folderInfo.GetValue(11);
unsigned int num_to_download = folderInfo.GetValue(18);
//
bool isexplicitpos=false;
if (strncmp(reg.c_str(),"LocalStore",10)==0) reg="1";
if (reg!="" && pindex==0)
{ bool isnum=true; for (unsigned int i=0; i<reg.length(); i++) {if (reg[i]<'0' || reg[i]>'9') isnum=false;}
if (isnum) sscanf(reg.c_str(),"%lu",&pos);
}
if (pos!=0) isexplicitpos=true; else pos=filepos;
TDbxFolderSorting *parent=0;
if (pindex!=0)
{ map<unsigned int,TDbxFolderSorting*>::const_iterator i = i2f.find(pindex);
if (i!=i2f.end()) parent=i->second;
}
bool isnews = (value==0);
//
if (!isnews)
{ TDbxFolderSorting *f = new TDbxFolderSorting;
f->index = index;
f->isexplicitpos = isexplicitpos;
f->position = pos;
f->info.name = name;
f->parent = parent;
if (parent==0 || parent->parent==0) f->info.path="";
else if (parent->info.path=="") f->info.path=parent->info.name;
else f->info.path=parent->info.path+"\\"+parent->info.name;
if (parent==0) f->info.account="";
else if (parent->parent==0) f->info.account=parent->info.name;
else f->info.account=parent->info.account;
string sf="";
if (f->info.account!="") sf += f->info.account+"\\";
if (f->info.path!="") sf += f->info.path+"\\";
sf += f->info.name;
f->info.full = sf;
f->info.fn = fn;
f->info.fpath = path;
if (parent==0) f->info.depth=0; else f->info.depth=parent->info.depth+1;
if (parent==0) f->info.type=dftStructure;
else if (!f->isexplicitpos) f->info.type=dftMail;
else if (pos==1) f->info.type=dftInbox;
else if (pos==2) f->info.type=dftOutbox;
else if (pos==3) f->info.type=dftSent;
else if (pos==4) f->info.type=dftDeleted;
else if (pos==5) f->info.type=dftDrafts;
else f->info.type=dftMail;
f->info.might_contain_offlines = (value==0 || value==1 || id0b==0x2F || num_to_download>0);
// That 'num to download' isn't reliable.
//
if (parent==0) folders.push_back(f);
else parent->c.push_back(f);
i2f.insert(pair<unsigned int,TDbxFolderSorting*>(index,f));
}
}
}
inm.close();

// Now sort them and save copies into the main list ane delete them
RecEnsureFolders(folders,true);
}

imemfile::imemfile(const char *fn)
{ buf=0; isokay=false; pos=0; hf=0; hmap=0; size=0; DWORD high;
if (fn!=0) hf = CreateFile(fn,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,NULL);
if (hf==INVALID_HANDLE_VALUE) isokay=false;
else size=GetFileSize(hf,&high);
if (high!=0 || size==0) {CloseHandle(hf);hf=0; isokay=false;}
else hmap=CreateFileMapping(hf,NULL,PAGE_READONLY,0,0,NULL);
if (hmap==NULL) {CloseHandle(hf); hf=0; isokay=false;}
else buf=(const char*)MapViewOfFile(hmap,FILE_MAP_READ,0,0,0);
if (buf==0) {CloseHandle(hmap); hmap=0; CloseHandle(hf); hf=0; isokay=false;}
else isokay=true;
}

imemfile::~imemfile()
{ close();
}

void imemfile::seekg(unsigned int apos)
{ if (buf==0 || apos>size) isokay=false; else pos=apos;
}

void imemfile::read(char *dst,unsigned int rsize)
{ if (buf==0 || pos+rsize>size) isokay=false;
else {memcpy(dst,buf+pos,rsize); pos+=rsize;}
}

bool imemfile::okay()
{ return isokay;
}

void imemfile::close()
{ if (buf!=0) UnmapViewOfFile(buf); buf=0;
if (hmap!=0) CloseHandle(hmap); hmap=0;
if (hf!=0) CloseHandle(hf); hf=0;
size=0; pos=0; isokay=false;
}

// IsValidDbxFile: to tell whether a given file is a valid DBX file
//
bool IsValidDbxFile(const string fn,bool wantfolders)
{ HANDLE hf = CreateFile(fn.c_str(),GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,NULL);
if (hf==INVALID_HANDLE_VALUE) return false;
DWORD high; DWORD size=GetFileSize(hf,&high);
CloseHandle(hf);
if (high!=0 || size<FileHeaderSize) return false;
bool okay=false;
imemfile inm(fn.c_str());
try
{ DbxFileHeader fileHeader(inm);
int4 length = fileHeader.GetValue(fhFileInfoLength);
int4 address = FileHeaderSize;
if (length+FileHeaderSize<=size)
{ DbxFileInfo inf(inm,address,length);
if (wantfolders) okay=fileHeader.isFolders();
else okay=!fileHeader.isFolders();
}
}
catch (...)
{
}
inm.close();
return okay;
}

bool IsValidDbxFolderFile(const string fn) {return IsValidDbxFile(fn,true);}
bool IsValidDbxMessageFile(const string fn) {return IsValidDbxFile(fn,false);}

8. 求助:outlook 2003 怎么编辑html邮件,内部查看源代码

首先,你可以用任意一个HTML编辑器编写HTML邮件正文,把它保存为.htm文件,然后利用下列方法之一把它放入Outlook邮件:
选择Outlook菜单“工具/选项”,在“邮件格式”选项卡中确保默认的邮件格式是HTML。然后,用IE打开包含邮件内容的.htm文件,选择IE菜单“文件/发送/电子邮件页面”。
在Outlook中,创建一个HTML格式的新邮件。用IE打开包含邮件内容的.htm文档,选择菜单“编辑/全选”、“编辑/复制”。切换到Outlook,点击邮件正文区域,选择菜单“编辑/粘贴”。
在Outlook中,创建一个HTML格式的新邮件,选择菜单“插入/文件”。在“插入文件”对话框中,选择包含邮件内容的.htm文件,然后点击“插入”按钮右边小箭头,选择菜单“作为文本插入”。

另外一种办法是用Word 2002/2000创建HTML文档。在Word中编写好文档后,选择Word菜单“文件/发送/邮件收件人”,这时Word文档上面会出现“收件人”、“抄送”、“主题”等输入框。发送邮件时,Word将使用HTML格式。遗憾的是,Word 2000会在HTML邮件中嵌入大量XML格式信息,达到数K之多,大大增加了邮件体积。但Word 2002提供了剥离这些XML代码的方法,该选项可按如下步骤设置:选择菜单“工具/选项”,选择“常规”选项卡下面的“电子邮件选项”,然后选中“常规”选项卡下面的“发送前筛选HTML”。

9. outlook 编辑网页源代码

无法复制的网页,笔者提供以下几种方法供大家选用(以IE(2)使用记事本查看网页的源代码: 方法同(1“编辑→粘贴”,即可将网页保存下来。 当遇到

阅读全文

与mfcoutlook源码相关的资料

热点内容
鸡料与鸡粪的算法 浏览:833
phpif变量为空值 浏览:59
iot编译器异常 浏览:600
代理服务器被禁用怎么上网 浏览:411
隐私加密怎么设置密码 浏览:940
马丁靴补色解压 浏览:565
在设置app上怎么找到个人热点 浏览:754
按照档案号生成文件夹 浏览:1000
程序员转方向 浏览:111
lol敏捷加密 浏览:882
传统公司眼中的加密货币 浏览:430
电脑图标又出现文件夹怎么去掉 浏览:964
排序算法c和a 浏览:418
手机拍照上传android 浏览:343
linux压缩率 浏览:614
电脑浏览器加密端口 浏览:536
单片机线性电源 浏览:268
韩国云服务器评测 浏览:740
python输出hello 浏览:594
如何在最左侧添加文件夹 浏览:500