An email with a pdf attachment -When it arrives at it sent destination the pdf can be read.
Hi Joel,
Thank you for writing to Aspose Support team.
We have tested this issue by attaching your sample PDF file and sending it using the API’s SmtpClient and no such issue was observed at the receiving end. The attachment can be downloaded and viewed without any issue.
Can you please share the email sample with PDF attachment with us that is received at the receiving end? We will try sending that from our end and share our feedback with you. Please also share your sample code with us for our reference.
I emailed you the pdf - I can not send it as an attachment
I sent it to Aspose.com - Automated Emal
It’s becoming a major issue in the company.
They must scan the pdfs and are encountering errors.
Below is the code:
To Summarize:
I’m sending the same way I receive it.
I’m just clearing the to, cc and bcc properties and replacing with other info also changing the Subject.
using Aspose.Email.Mail;
using Aspose.Email.Outlook;
using Aspose.Email.Pop3;
using Aspose.Email;
using Aspose.Email.Mime;
using Aspose.Email.Imap;
private static void SendEmail(MailMessage xoEmail, string xsSubject, string xsFrom, bool xbForward, bool xbTracking)
{
try
{
SmtpClient moClient = new SmtpClient(ConfigurationManager.AppSettings["EmailHost"], 25, ConfigurationManager.AppSettings["EmailUsername"], ConfigurationManager.AppSettings["EmailPswd"]);
moClient.SecurityOptions = SecurityOptions.Auto;
xoEmail.CC.Clear();
xoEmail.Bcc.Clear();
xoEmail.To.Clear();
string psPrefixSubject = ConfigurationManager.AppSettings["Prefix Subject"];
string psSendTo = ConfigurationManager.AppSettings["Forward Emails To"];
string psLateNotice = ConfigurationManager.AppSettings["Forward Emails With Late Notice To"];
string psEmailTracking = ConfigurationManager.AppSettings["Forward Emails To Tracking Scan"];
string psSentToAp = "";
if (xbForward)
{
psSentToAp = "<<>> ";
}
if (xbTracking)
{
xoEmail.CC.Add(psEmailTracking);
}
if (xbForward)
{
xoEmail.CC.Add(psLateNotice);
}
xoEmail.To.Add(psSendTo);
xoEmail.Subject = psSentToAp + psPrefixSubject + xsSubject;
moClient.Send(xoEmail);
}
catch (Exception exc)
{
string psErrorFile = "EmailErrorLogSendError.txt";
DateTime now = DateTime.Now;
int plErrorCode = System.Runtime.InteropServices.Marshal.GetExceptionCode();
if (plErrorCode == -532459699)
{
psErrorFile = "EmailErrorLogSendError532459699.txt";
}
using (StreamWriter outfile = File.AppendText(@ConfigurationManager.AppSettings["EmailErrors"] + psErrorFile))
{
outfile.WriteLine(now + @" Email From: " + xsFrom + " Subject: " + xsSubject + " Reason: " + exc.Message.ToString());
outfile.Close();
}
try
{
EmailLogger.SendTheEmail(ConfigurationManager.AppSettings["EmailSenderAddr"], xsFrom, xoEmail.Subject, xoEmail.Body, xoEmail, null);
now = DateTime.Now;
using (StreamWriter outfile = File.AppendText(@ConfigurationManager.AppSettings["EmailErrors"] + "EmailSuccessLogOpmx.txt"))
{
outfile.WriteLine(now + @" Email From: " + xsFrom + " Subject: " + xsSubject + " Success!");
outfile.Close();
}
}
catch (Exception ex)
{
now = DateTime.Now;
using (StreamWriter outfile = File.AppendText(@ConfigurationManager.AppSettings["EmailErrors"] + "EmailErrorLogOpmx.txt"))
{
outfile.WriteLine(now + @" Email From: " + xsFrom + " Subject: " + xsSubject + " Reason: " + ex.Message.ToString());
outfile.Close();
}
}
Console.WriteLine(exc.Message);
}
}
It’s acrobat 4.0 Could that be a problem?
Hi Joel,