473,388 Members | 1,026 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Adding attachment to mobile email application

132 100+
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 3210
E11esar
132 100+
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
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,...
0
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...

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.