电子邮件SMTP附件显示为无标题1 [英] Email SMTP attachment shows untitled1

查看:199
本文介绍了电子邮件SMTP附件显示为无标题1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用过:

CSMTPMessage* pMessage = CreateMessage("test_host@hotmail", "test_client@hotmail" ,"c:\\Docs\\Letter.txt");


电子邮件和附件发送成功,但是客户端中的附件显示始终为 untitle1 ... 不是 Letter.txt

任何人都可以帮助定义附件标题吗? :doh:

以防万一,我附加了功能CreateMessage:


The Email & attachment sending sucessfully, however the attachment show in the client was always untitle1 ... not Letter.txt!

Anyone can help how to define the attachment title? :doh:

Just in case, I attach the function CreateMessage:

CSMTPMessage* CConfirmation::CreateMessage(CSMTPAddress FromAddr, CString ToAddr, CString Attachment)
{
    CSMTPMessage* pMessage          = new CSMTPMessage;

    pMessage->AddMultipleRecipients(ToAddr , CSMTPMessage::TO);
    pMessage->m_sSubject = "Email Confirmation";

    //Attach file here
    pMessage->AddMultipleAttachments(Attachment);

    pMessage->m_From = FromAddr;
    pMessage->m_ReplyTo = FromAddr;

    //New code
    pMessage->AddTextBody(EmailBody);

    #ifdef _DEBUG
      pMessage->AddCustomHeader(_T("X-Program:    CSTMPMessageTester"));
    #endif

    return pMessage;
}

推荐答案

尚不清楚您使用的CSMTPMessage类来自何处.如果来自此文章 [ ^ ],然后是 ^ ]附件类的方法可能会帮助您.我不知道为什么您会看到无标题". :)
It''s unclear where the CSMTPMessage class you are using has come from. If it is from this article[^], then the SetTitle[^] method of the attachment class may help you out. I have no idea why you are seeing Untitled though. :)


这篇关于电子邮件SMTP附件显示为无标题1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆