Hi
I am trying to send a .pdf document as an email attachment using net.mail.
This email is being sent by a windows service application. After i receive
the email, and when i try to open the attachment, i get the following error
message...
"adobe reader could not open <filenamebecuas e it is either not a
suppported file type or because the file has been damaged(for example, it was
sent as an email attachment and wasn't correctly decoded)"
Here is a glimpse of the code doing the emailing..
Dim Mail_Message As MailMessage = New MailMessage(obj Email.MailFrom,
objEmail.MailTo )
Dim Server_Name As SmtpClient = New SmtpClient(Mail Server)
Dim Port_Number As Int32 = Convert.ToInt32 (MailServerPort Number)
With Mail_Message
.Body = Trim(objEmail.M essage)
.Subject = Trim(objEmail.S ubject)
.Priority = objEmail.Priori ty
.IsBodyHtml = True
.BodyEncoding = System.Text.Enc oding.Unicode
For Each oAttachment As Attachment In objEmail.Attach ments
.Attachments.Ad d(oAttachment) 'Here is where i am
attaching the file
Next
End With
Server_Name.Sen d(Mail_Message) 1 3274
Are you also generating the PDF file in your program? Is this segment being
triggered by a filesystemwatch er?
It's possible that you're attempting to send the PDF before it has been
fully generated. Verify this by comparing the version that you've received
in your inbox and with the version of the file that you're trying to send in
a hex reader. My bet is that there are some critical bits in the latter part
of the PDF that are missing from the version that was emailed.
If this is indeed the problem, the solution here is simply to wait until the
file is done being written to. Try using the System.IO library to open the
file exclusively. If you can't, then the file isn't ready. Wait a few
milliseconds and try again until the PDF is done.
Cheers,
-M
"Sai Vajja" <Sa******@discu ssions.microsof t.comwrote in message
news:F7******** *************** ***********@mic rosoft.com...
Hi
I am trying to send a .pdf document as an email attachment using net.mail.
This email is being sent by a windows service application. After i receive
the email, and when i try to open the attachment, i get the following
error
message...
"adobe reader could not open <filenamebecuas e it is either not a
suppported file type or because the file has been damaged(for example, it
was
sent as an email attachment and wasn't correctly decoded)"
Here is a glimpse of the code doing the emailing..
Dim Mail_Message As MailMessage = New MailMessage(obj Email.MailFrom,
objEmail.MailTo )
Dim Server_Name As SmtpClient = New SmtpClient(Mail Server)
Dim Port_Number As Int32 =
Convert.ToInt32 (MailServerPort Number)
With Mail_Message
.Body = Trim(objEmail.M essage)
.Subject = Trim(objEmail.S ubject)
.Priority = objEmail.Priori ty
.IsBodyHtml = True
.BodyEncoding = System.Text.Enc oding.Unicode
For Each oAttachment As Attachment In objEmail.Attach ments
.Attachments.Ad d(oAttachment) 'Here is where i am
attaching the file
Next
End With
Server_Name.Sen d(Mail_Message) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Jonathan M. Rose |
last post by:
I am looking for a script that I can sit on an HTML server (Linux,
Apache, PHP/Perl/Python/Etc.) that will allow me to do the following things:
1) Post news articles that consists of (i) a title and (ii) a body.
2) Show the last X posts (or, better yet, just the last X titles) on a
home page.
3) Show all posts on a "news" page.
4) When a news article is posted, email the news article (with the title
being the email subject and the news...
|
by: Chuck |
last post by:
I have a database that has a table in it with employee information (name,
dob, email, etc). This is joined to a table that has tasks that are
assigned to each individual that has a recurring date. For example, Joe
must take an annual CPR class, Bob needs to take his Hearing Test, Ann must
take her Eye Exam. The task table keeps the completed date in it, while the
form that displays it calculates the next due date (using dateadd). So, as...
|
by: Strasser |
last post by:
In Access2000 mass emailing worked perfectly (very powerful tool!).
Doesn't work when using XP version of both Access and Outlook, even
though I checked the box to ensure that I was sending the email. Any
ideas?
Thanks in advance.
|
by: Stanley Cheung |
last post by:
Hi all,
I am developing the application for send emailing list,
actually, i can perform to send a email 1 by 1 and do it on aspx page.
I have a enquiry that how can the application change to background task
instead of user need to wait and wait until all email sent.
Also, when user waiting to complete the emailing list, the page is blank and
nothing, can we put a layout when user waiting a request.
|
by: ryan |
last post by:
I've been tasked with consuming a Perl web service that was written by a
person in a different department of my company. The problem is it's the
guy's first attempt at web services and he doesn't know how to create the
WDSL. I created web service with Visual Studio that mimics his service and
after some tweaking of the soapAction in the WSDL I'm able to call his
service successfully. When I use SOAPScope to look the messages being sent
and...
| |
by: number1.email |
last post by:
I have tried the following code:
FileName: index2.php
---------------------------------
<?
mail( "aaa@yahoo.com", "A", "B", "From: a...@aol.com" );
echo "Finished Emailing.";
?>
|
by: Giggle Girl |
last post by:
Hi there,
I am having a problem with the behavior of Firefox, where lefthand
column content is not resized properly after it is "collapsed" and then
"re-expanded". An online demo is available here:
http://s161149005.onlinehome.us/DEMOS/FF/RESIZE_PROB/main/frameset.asp
It works fine in IE 6, but in Firefox, it is broken. Specifically,
when the page/frameset first loads in either browser, it looks correct.
But when you click the...
|
by: skyson2ye |
last post by:
Hi, guys:
I have written a piece of code which utilizes Javascript in PHP to create a three level dynamic list box(Country, States/Province, Market). However, I have encountered a strange problem, and I have spent three days trying to debug but to no avail.
Everything is OK when there are only two dependent list boxes, but when adding the third child list box, a problem appears: if I populate the third box only with the value: new...
|
by: marjbell |
last post by:
I have a Access database of email addresses that I would like to mass
email to customers. Can Access be used through Outlook? or can it just
be done with Access? I know it is possible to use MailMerge for
snailMail.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |