473,405 Members | 2,261 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,405 software developers and data experts.

C# APP:How to send a mail

13
Hi Friends,,


I have developed in my project c# .net . windows application. i will send any mail thru my application. i dont know.. any other know tell me.. give code.





Regards,

bala
Mar 31 '08 #1
3 885
dip_developer
648 Expert 512MB
Hi Friends,,

I have developed in my project c# .net . windows application. i will send any mail thru my application. i dont know.. any other know tell me.. give code.

Regards,

bala
Expand|Select|Wrap|Line Numbers
  1.  
  2. MailMessage objEmail          = new MailMessage();
  3.             objEmail.To       = txtTo.Text;
  4.             objEmail.From     = txtFrom.Text;
  5.             objEmail.Cc       = txtCc.Text;
  6.             objEmail.Subject  = "Test Email";
  7.             objEmail.Body     = txtName.Text + ", " +
  8.                                 txtComments.Text;
  9.             objEmail.Priority = MailPriority.High;
  10.   //SmtpMail.SmtpServer = "localhost";
  11.   try{
  12.     SmtpMail.Send(objEmail);
  13.     Response.Write("Your Email has been sent sucessfully -
  14.                     Thank You");
  15.   }
  16.   catch (Exception exc){
  17.     Response.Write("Send failure: " + exc.ToString());
  18.   }
  19.  
Mar 31 '08 #2
winbala
13
Thanks. i want from any from address to any to address .. i will send mail..

example my client domain name id to yahoo or gmail or hotmail anything.


or

i will send yahoo from gmail or hotmail



regards
bala
Mar 31 '08 #3
Plater
7,872 Expert 4TB
Does hotmail allow smtp usage? I know google will but you have to manually enable it in the account settings.

If you have a valid SMTP server (and user credentials) you can send to anywhere.
Mar 31 '08 #4

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

Similar topics

0
by: Jon Moldover | last post by:
Hi, I'm using Python in my win32 app by linking to the python23.dll. I'm trying to expose some c++ code in my app to Python so I can make application calls from Python scripts (according to the...
1
by: David | last post by:
Hi, I am developing a NotifyIcon app with C#. I want to show the context menu when user left-clicks on the icon, the same as he/she right-clicks on it. In that event handler,...
3
by: Bob | last post by:
I haver a user login form (winforms app using vs2005 in VB.NET). After succesfull validayion of user I want to open a first form and close the loging form that was used, If I write If...
1
by: mlohr | last post by:
For my intranet Rails app I need to get the windows logon from the user. I know it must be possible, but how?
1
by: Alfonso2968 | last post by:
I have two apps written in c# I have integrated them together into one app. I have the second apps form opening in the main form of my first app instead of in the Tab. I basically want the...
4
by: PulkitZery | last post by:
Hi Everyone, I need some help here; I have a school project that needs me to upload files to my server. The files are BIG (bigger then 200-300 MB) and I need to send them to the server from client...
3
by: TriAdmin | last post by:
I have a web-based app where all subscribers are logged in to the site. When Person A presses a button to notify Person B that someone is here to see him, Person B gets a popup on his screen...
3
by: confused1234 | last post by:
Hi, I am about to deply my first winforms project. I recently learnt that the users needs .net installed on their machine. I stupidly thought that this would be package automatically with...
2
by: benhania | last post by:
for exemple (in windows form app) - while the up arrow key is pressed an image will move up. how do i read the key and the key release? thanx.
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
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,...
0
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
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
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...

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.