标签: attachment

无法在iphone上发送带有视频/音频附件的电子邮件!

我正在尝试使用MFMailComposeViewController发送电子邮件.我可以发送附有图像的电子邮件,但是当我尝试附加mp3或mp4文件时,我收到以下消息:

DA |无法在/tmp/DAAccountsLoading.lock中打开锁定文件.无论如何我们都会加载帐户,但可能会发生不好的事情

(如果似乎在我开始填写"To"字段后出现,并且发送消息失败.

这是我的代码(HelperUtils类只是我创建的东西,我确定问题不存在):

NSData *myData = [NSData dataWithContentsOfFile:[HelperUtils getPathWithEnding:media.name]];
NSString *mimeTypeStr = [HelperUtils getMimeTypeOfFileWithPath:[HelperUtils getPathWithEnding:media.name]];
NSLog(mimeTypeStr);
NSLog([HelperUtils getPathWithEnding:media.name]);
[picker addAttachmentData:myData mimeType:mimeTypeStr fileName:media.name];
Run Code Online (Sandbox Code Playgroud)

email iphone video attachment mfmailcomposeviewcontroller

1
推荐指数
1
解决办法
8036
查看次数

如何在Android上的应用程序中打开电子邮件附件?

我想打开一个特定类型的文件,我的应用程序已经可以通过电子邮件将其作为附件发送.我需要能够让Android电子邮件应用程序选择我的应用程序下载或打开该特定的文件类型.我无法弄清楚如何设置一个意图过滤器,让我这样做.有谁知道这是怎么做的?

email android attachment download intentfilter

1
推荐指数
1
解决办法
5965
查看次数

如何使用JavaScript将文件附加到电子邮件中?

我正在为我的班级制作一张表来记录他们每天所做的事情.

在本周末,人们需要通过电子邮件将文件发送给他们的老师.

有没有办法使用JavaScript自动将当前文件附加到电子邮件?

谢谢.

编辑:哦,这也必须与IE7和Outlook 2007一起使用.

html javascript email-integration attachment

1
推荐指数
1
解决办法
7840
查看次数

C#fileattachment内容为字符串

我想从电子邮件中的附件中获取内容.我能够阅读电子邮件及其所有属性.附件是一个文本文件(.txt).我如何获取附件的实际文本内容?下面是我的代码的一部分,显示我如何获取每封电子邮件,然后获取其属性并将其存储在findResults列表中.像fileAttachment.Name这样的东西会给我附件的名称.fileAttachment.content.tostring()只显示system.Byte [].

FindItemsResults<Item> findResults = service.FindItems(fid1, new ItemView(int.MaxValue));
service.LoadPropertiesForItems(from Item item in findResults select item, PropertySet.FirstClassProperties);

foreach (Item item in findResults)
{
    String body = "";
    #region attachments
    if (ReadAttachments == "1")
    {
        EmailMessage message = EmailMessage.Bind(service, item.Id, new PropertySet(BasePropertySet.IdOnly, ItemSchema.Attachments));

        foreach (Attachment attachment in message.Attachments)
        {
            if (attachment is FileAttachment)
            {
                FileAttachment fileAttachment = attachment as FileAttachment;

                // Load the file attachment into memory and print out its file name.
                fileAttachment.Load();

                String attachbody = fileAttachment.Content.ToString();

                if (attachbody.Length > 8000) …
Run Code Online (Sandbox Code Playgroud)

c# email exchange-server attachment exchangewebservices

1
推荐指数
1
解决办法
3580
查看次数

phpMailer附件不起作用

这是我的第一篇文章,我希望能在phpMailer联系表单中添加附件字段方面获得一些帮助.我已经在html网站上添加了一个上传者[浏览]栏,但我不知道如何将它与phpmailer链接.我是否必须在phpmailer.php包中声明它或用它做一些事情?

我真的很感激一些帮助.以下是我绝望的尝试.

代码片段:

<?
$body = ob_get_contents();

$to = 'xxx@xxxx.com>';
$email = $email;
$subject = $subject;
$fromaddress = "xxx@xxxx.com";
$fromname = "Online Contact";

require("phpmailer.php"); //<<this is the original pack

$mail = new PHPMailer();

$mail->From     = "xxx@xxxx.com";
$mail->FromName = "My Name";
$mail->AddBCC("xxx@xxxx.com","Name 1");
$mail->AddAddress( $email,"Name 2");

$mail->WordWrap = 50;
$mail->IsHTML(true);

$mail->Subject  =  $subject;
$mail->Body     =  $body;
$mail->AltBody  =  "This is the text-only body";
// attachment
$mail->AddAttachment('uploadbar', 'new_file.pdf'); // the name of my html uploader is uploadbar, clicking browse to locate a …
Run Code Online (Sandbox Code Playgroud)

php attachment contact phpmailer contact-form

1
推荐指数
1
解决办法
9075
查看次数

将上传的文件作为附件发送到电子邮件

我是Web设计的新手。我需要创建一个HTML表单,以要求用户输入几个字段并上传他/她的简历。当他提交表格时,他的提交材料应该以电子邮件的形式发送给我,并将其简历作为电子邮件的附件。我已使用PHP发送电子邮件。一切正常,除了文件未与发送的电子邮件一起附加。

我同时发布了HTML和PHP代码,请帮助我。

HTML代码:FileName:Careers.html

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contact Form</title>
</head>

<body>
<form action="Careers.php" method="post" enctype="multipart/form-data">
    Name<br>
     <input type="text" name="cf_name"><br>
    E-mail<br>
     <input type="text" name="cf_email"><br>
        Date of Birth<br>
     <input type="text" name="db_name"><br>
        Contact Number<br>
     <input type="text" name="db_cntct"><br>
    Class 12 Marks/CGPA/Percentage<br>
     <input type="text" name="cf_board"><br>
         Graduation Marks/CGPA/Percentage<br>
     <input type="text" name="db_grad"><br>
     Post-Graduation Marks/CGPA/Percentage<br>
     <input type="text" name="cf_pgrad"><br>
        Present Employer<br>
     <input type="text" name="db_emplyr"><br>
     Date of Joining<br>
     <input type="text" name="cf_doj"><br>
        Designation<br>
     <input type="text" name="db_desg"><br>
        Current CTC<br>
     <input …
Run Code Online (Sandbox Code Playgroud)

html php forms email attachment

1
推荐指数
1
解决办法
4万
查看次数

在对IDisposable的引用上调用dispose()

我有一些代码来添加电子邮件的附件.我是通过类构造函数的Stream重载添加它们的Attachment.执行此操作的代码如下所示:

List<UploadedDocument> docs = DataBroker.GetUploadedDocs(Convert.ToInt32(HttpContext.Current.Session["offer_id"].ToString()));
//no need to keep this in session
HttpContext.Current.Session["offer_id"] = null;
int counter = 1;
foreach (UploadedDocument doc in docs)
{
    stream = new MemoryStream(doc.doc);
    attach = new Attachment(stream, "Attachment-" + counter.ToString());
    message.Attachments.Add(attach);              
}
Run Code Online (Sandbox Code Playgroud)

doc.doc字节数组在哪里.我想正确处理每一个附件和流的,但我不能这样做,直到该消息已发送,所以我想只是将其添加到List<Attachment>List<Stream>,然后通过迭代和呼叫处理.

像这样的东西:

List<Attachment> attachments;
List<Stream> streams;
//...
foreach(UploadedDocument doc in docs)
{
    stream = new MemoryStream(doc.doc);
    streams.Add(stream);
    attach = new Attachment(stream,"Name");
    attachments.Add(attach);
    message.Attachments.Add(attach);
}
//other processing
emailClient.Send(message);

if(attachments != null)
{
    foreach(Attachment attachment …
Run Code Online (Sandbox Code Playgroud)

c# email idisposable attachment

1
推荐指数
1
解决办法
231
查看次数

在Wordpress的主页上显示随机帖子附件

我正在尝试将1个随机图像附加到帖子上,并将其显示在首页上(更改刷新时显示的图像).我看到的所有代码都展示了如何在帖子页面的循环中显示附件,但这将从一个页面获取附件并将​​其显示在不同的页面上.

任何帮助都会很大,因为我没有真正的起点.

wordpress image attachment

1
推荐指数
1
解决办法
2100
查看次数

隐藏粘贴在Lotus Rich Text字段中的附件

如何隐藏粘贴在富文本字段中的Lotus Notes文档中的附件?使用附加图标可以使用hide-when公式隐藏附件!@IsNewDoc,如果粘贴它,即使在公式时隐藏相同的情况下它仍然可见.(Lotus Notes 8.5.3客户端)保存并重新打开文档后,仍会显示附件.(似乎@isnewdoc不起作用)

lotus-notes copy-paste attachment richtext

1
推荐指数
1
解决办法
1887
查看次数

如何使用restsharp在电子邮件中附加memorystream对象?

我想知道您是否可以帮我使用RestSharp为电子邮件附件添加MemoryStream附件对象?

这是我从MailGun获得的代码,但它在此示例中附加了一个物理文件:

谢谢.

public static IRestResponse SendComplexMessage() {
       RestClient client = new RestClient();
       client.BaseUrl = "https://api.mailgun.net/v2";
       client.Authenticator =
               new HttpBasicAuthenticator("api",
                                          "key-3ax6xnXXXXXXXX");
       RestRequest request = new RestRequest();
       request.AddParameter("domain",
                            "samples.mailgun.org", ParameterType.UrlSegment);
       request.Resource = "{domain}/messages";
       request.AddParameter("from", "Excited User <me@samples.mailgun.org>");
       request.AddParameter("to", "foo@example.com");
       request.AddParameter("cc", "baz@example.com");
       request.AddParameter("bcc", "bar@example.com");
       request.AddParameter("subject", "Hello");
       request.AddParameter("text", "Testing some Mailgun awesomness!");
       request.AddParameter("html", "<html>HTML version of the body</html>");

// I need to add memorystream object here ---
       request.AddFile("attachment", Path.Combine("files", "test.jpg"));
       request.AddFile("attachment", Path.Combine("files","test.txt"));
// -------------------------------------------

       request.Method = Method.POST;
       return client.Execute(request);
}
Run Code Online (Sandbox Code Playgroud)

email memorystream attachment restsharp

1
推荐指数
1
解决办法
1783
查看次数