473,503 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding attachment to mobile email application

132 New Member
Hi there.

I am developing a mobile device application which has an OpenFileDialog control which copies an image into a PictureBox, code as follows:

Expand|Select|Wrap|Line Numbers
  1. try
  2.  
  3. {
  4.  
  5. OpenFileDialog open = new OpenFileDialog(); 
  6. open.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp";
  7.  
  8. if (open.ShowDialog() == DialogResult.OK) 
  9. {
  10.  
  11. pbImage.Image = new Bitmap(open.FileName);pbImage.SizeMode = PictureBoxSizeMode.CenterImage; 
  12. }
  13.  
  14. }
  15.  
  16. catch (Exception) 
  17. {
  18.  
  19. throw new ApplicationException("Failed loading image"); 
  20. }
  21.  
  22.  
That all works fine but what I also want to do is to email this image as an attachment of an email. This email functionality is within another Button click event as other fields in the mobile device form are included in the email as text.

Can anybody suggest some way(s) I can use to capture this image as an attachment, as well as displaying it in a picture box please?

Thank you.

M :o)
Mar 30 '09 #1
1 3217
E11esar
132 New Member
I was able to solve this one. Simply a case of setting a string variable to ve equal to the open.FileName value in the code above, then instantiating a new Attachment and passing this the respective string value in the constructor.

All done.

Thank you.

Mark :o)
Mar 31 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3165
by: knoak | last post by:
Hi there, I've found a script at these great Google fora. a script to send emails with attachments. The script is below this message, name etc. aren't mine, but from the original post. My...
4
5553
by: DeeJay | last post by:
Hi all. I need to create program that will extract attachments from Outlook 2000 inbox and save it on disk. Detailed how-to & sample code would be highly appreciated. Regards, DeeJay.
1
1182
by: Bart Stes | last post by:
Hey guys, I'm try to write a very simple winform app that allows the users to send an email. I use the System.Web.Mail MailMessage class for this. But when it comes to adding an attachment,...
3
1604
by: Bart Stes | last post by:
Hey guys, I'm try to write a very simple winform app that allows the users to send an email. I use the System.Web.Mail MailMessage class for this. But when it comes to adding an attachment,...
5
5334
by: Kosmos | last post by:
I have traveled the world and the seven seas and I have yet to come up with an answer to this question.... So I'm adding an attachment to an email from access... The following is the code: ...
2
3646
by: Kosmos | last post by:
Alright so I've got this Outlook code written in VBA in Access. The first part, which works, records information about appointment times based on the required days before notification of certain...
0
5366
by: jibysubhash | last post by:
hi all i have got a php code which sends attachments via mail..... Please help me how to send the file parameters to the php via http service send method.... i am placing the php and flex codes here ...
1
1715
by: santosh singh | last post by:
for mobile browser i used the following code : Response.ContentType = "application/vnd.wap.xhtml+xml"; Response.AppendHeader("Content-Disposition","attachment; filename=SailBig.jpg");...
7
3235
by: cj2 | last post by:
I saw a MS demo a few years back where they developed a web page and the software automatically rendered it for different devices. Is this what I'm looking for? http://www.asp.net/mobile/ ...
0
7322
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6982
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7451
tracyyun
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...
0
5572
agi2029
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,...
1
5000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4667
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...
0
3161
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...
0
1501
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 ...
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.