Wednesday, March 30, 2016
Sending an Email With and Without Attachments Using C#
Sending an Email is important thing for every Dot net developer working in web applications project. Sometimes required to need send with attachments in email. Sending an email with attachment is easy and simple in C# to send. Follow the below steps to implement in your projects.
In this post I am discussing to send an email in two different ways
1. Send e-mail via SMTP (Gmail) using C#.
2. Send e-mail via Host Address using C#.
Note: Add these namespace in your code behind or Controller in C#.
using System.Net;
using System.Net.Mail;
1. Send e-mail via SMTP (Gmail) using C#.
Function for Without Attachment
protected void sendEmail()
{
using (MailMessage message = new MailMessage())
{
message.From = new MailAddress("from_address@gmail.com");
message.To.Add(new MailAddress("to_address@test.med.ca"));
message.CC.Add(new MailAddress("copy@domain.com"));
message.Subject = "Special Medication Request from " + txtPhyName.Text.ToString() + " , " + txtPosTile.Text; //Subject Here
message.Body = "Drug Name: " + txtdrugName.Text.ToString() + "\n" + "Quantity: " + txtQtyReq.Text; //Body Of Email Content
SmtpClient client = new SmtpClient("smtp.gmail.com"));
client.Port = 587;
client.Credentials = new System.Net.NetworkCredential("your mail@gmail.com", "your password");
client.EnableSsl = true;
client.Send(message);
}
}
Function for With Attachment
protected void sendEmail()
{
using (MailMessage message = new MailMessage())
{
message.From = new MailAddress("from_address@gmail.com");
message.To.Add(new MailAddress("to_address@test.med.ca"));
message.CC.Add(new MailAddress("copy@domain.com"));
message.Subject = "Special Medication Request from " + txtPhyName.Text.ToString() + " , " + txtPosTile.Text; //Subject Here
//Attachment goes here
System.Net.Mail.Attachment attach;
attach = new System.Net.Mail.Attachment("c:/www/root/filename.png //file extension");
attach.Name = "map.png"; // Here You can describe your filename with or without extension
message.Attachments.Add(attach);
message.Body = "Drug Name: " + txtdrugName.Text.ToString() + "\n" + "Quantity: " + txtQtyReq.Text; //Body Of Email Content
SmtpClient client = new SmtpClient("smtp.gmail.com"));
client.Port = 587;
client.Credentials = new System.Net.NetworkCredential("your mail@gmail.com", "your password");
client.EnableSsl = true;
client.Send(message);
}
}
Function for With Multiple Attachments
protected void sendEmail()
{
using (MailMessage message = new MailMessage())
{
message.From = new MailAddress("from_address@gmail.com");
message.To.Add(new MailAddress("to_address@test.med.ca"));
message.CC.Add(new MailAddress("copy@domain.com"));
message.Subject = "Special Medication Request from " + txtPhyName.Text.ToString() + " , " + txtPosTile.Text; //Subject Here
//Attachment 1
System.Net.Mail.Attachment attach;
attach = new System.Net.Mail.Attachment("c:/www/root/filename.png //file extension");
attach.Name = "map.png"; // Here You can describe your filename with or without extension
message.Attachments.Add(attach);
//Attachment 2
System.Net.Mail.Attachment attach2;
Attach2 = new System.Net.Mail.Attachment("c:/www/root/filename.png //file extension");
Attach2.Name = "map.png"; // Here You can describe your filename with or without extension
message.Attachments.Add(attach2);
message.Body = "Drug Name: " + txtdrugName.Text.ToString() + "\n" + "Quantity: " + txtQtyReq.Text; //Body Of Email Content
SmtpClient client = new SmtpClient("smtp.gmail.com"));
client.Port = 587;
client.Credentials = new System.Net.NetworkCredential("your mail@gmail.com", "your password");
client.EnableSsl = true;
client.Send(message);
}
}
2. Send e-mail via Host Address using C#.
Function for Without Attachment
protected void sendEmail()
{
using (MailMessage message = new MailMessage())
{
message.From = new MailAddress("from_address@gmail.com");
message.To.Add(new MailAddress("to_address@test.med.ca"));
message.CC.Add(new MailAddress("copy@domain.com"));
message.Subject = "Special Medication Request from " + txtPhyName.Text.ToString() + " , " + txtPosTile.Text; //Subject Here
message.Body = "Drug Name: " + txtdrugName.Text.ToString() + "\n" + "Quantity: " + txtQtyReq.Text; //Body Of Email Content
SmtpClient client = new SmtpClient();
client.Host = "10.10.18.10"; // Mention your server host IP Address Here
client.EnableSsl = true;
client.Send(message);
}
}
Function for With Attachment
protected void sendEmail()
{
using (MailMessage message = new MailMessage())
{
message.From = new MailAddress("from_address@gmail.com");
message.To.Add(new MailAddress("to_address@test.med.ca"));
message.CC.Add(new MailAddress("copy@domain.com"));
message.Subject = "Special Medication Request from " + txtPhyName.Text.ToString() + " , " + txtPosTile.Text; //Subject Here
//Attachment goes here
System.Net.Mail.Attachment attach;
attach = new System.Net.Mail.Attachment("c:/www/root/filename.png //file extension");
attach.Name = "map.png"; // Here You can describe your filename with or without extension
message.Attachments.Add(attach);
message.Body = "Drug Name: " + txtdrugName.Text.ToString() + "\n" + "Quantity: " + txtQtyReq.Text; //Body Of Email Content
SmtpClient client = new SmtpClient();
client.Host = "10.10.18.10"; // Mention your server host IP Address Here
client.EnableSsl = true;
client.Send(message);
}
}
Function for send an email Multiple Attachments Using c#
protected void sendEmail()
{
using (MailMessage message = new MailMessage())
{
message.From = new MailAddress("from_address@gmail.com");
message.To.Add(new MailAddress("to_address@test.med.ca"));
message.CC.Add(new MailAddress("copy@domain.com"));
message.Subject = "Special Medication Request from " + txtPhyName.Text.ToString() + " , " + txtPosTile.Text; //Subject Here
//Attachment 1
System.Net.Mail.Attachment attach;
attach = new System.Net.Mail.Attachment("c:/www/root/filename.png //file extension");
attach.Name = "map.png"; // Here You can describe your filename with or without extension
message.Attachments.Add(attach);
//Attachment 2
System.Net.Mail.Attachment attach2;
Attach2 = new System.Net.Mail.Attachment("c:/www/root/filename.png //file extension");
Attach2.Name = "map.png"; // Here You can describe your filename with or without extension
message.Attachments.Add(attach2);
message.Body = "Drug Name: " + txtdrugName.Text.ToString() + "\n" + "Quantity: " + txtQtyReq.Text; //Body Of Email Content
SmtpClient client = new SmtpClient();
client.Host = "10.10.18.10"; // Mention your server host IP Address Here
client.EnableSsl = true;
client.Send(message);
}
}
Using above function call in any events to send an email. We can use these in Contact us Form and many more areas where ever required.
If you have any problem in coding comment it here. As soon as possible we will reply to you.
Sunday, March 27, 2016
Top 10 University in United Kingdom
Top and Best Universities in United Kingdom
As of December 2015, there were one hundred and six universities and university colleges in England out of a total of around 130 in the United Kingdom.
This is a list of Best and Top institutions in the United Kingdom. United Kingdom is best place to do degree and Higher studies. The Quality of education in United Kingdom is best and latest technologies has been modeled. United Kingdom Providing world-class education in worldwide. UK higher education offers you inspiring teaching, excellent facilities and a world-class research environment. Half of the world's top eight universities are in the UK.
- University of Cambridge
- University of Oxford
- London School of Economics and Political Science
- Imperial College London
- Durham University
- University of St Andrews
- University of Warwick
- University College London
- University of Edinburgh
- Lancaster University
- University of Surrey
- University of Exeter
- King’s College London
- University of Manchester
- University of Bristol
- University of Glasgow
93% of postgraduate students rated the UK's quality of teaching positively.The rate of student satisfaction among international undergraduates is at 91% – higher than any other major English-speaking education destination.
Over 88% of international graduates are satisfied with their UK learning experience . The UK is a world-leading research nation in the worldwide.
UK education is all about giving you the inspiration to help you develop your skills, the freedom to be creative, and the support you need to achieve your best.
UK universities and colleges invest in excellent facilities – from libraries, computer and science labs to sports centers, theaters and art studios. Class sizes are restricted to ensure that you have access to equipment and enough time to talk to your tutors and lecturers.
UK undergraduate and postgraduate courses are generally shorter than in other countries, helping to keep the cost of tuition fees and living expenses down.
UK universities and colleges are regularly reviewed to ensure high standards of academic education, teaching, accommodation, welfare support and facilities.
UK undergraduate and postgraduate courses are generally shorter than in other countries. This helps to keep tuition fees and living expenses down. Most full-time undergraduate courses take three years to complete. Full-time postgraduate courses can take one year or more.
Tuition fees for UK higher education courses vary, depending on factors including: whether you are from the European Union/European Economic Area; where in the UK you are studying (there are different rules for England, Scotland, Northern Ireland and Wales); and whether you are studying at undergraduate or postgraduate level.
There are a number of good scholarship and financial support schemes for UK higher education courses. Demand can be high, but it is well worth taking a look at what is available.Top 10 University in United Kingdom
Top and Best Universities in United Kingdom
Nearly 50 universities in London, including some of the best universities in the world, offer over 10,000 courses for students from around the world.
Indian students can stay on for six months after graduating to look for employment in France in their line of work. Once hired, a long-stay work permit is readily obtainable with the help of the company.Top 10 University in United Kingdom
Reasons for Indian Students to Study in the UK
- Internationally recognized qualifications
- High Quality of education
- Opportunities offered by UK education system
- Strong research activities and infrastructure
- An interesting place to live
- Work and study
- Work permit after study
- Scholarship and financial support (Bank Loans)
- Health benefits
- Cross-cultural experience
Top 10 University in United Kingdom
Wednesday, March 23, 2016
6 Things To Do During Your Notice Period
Notice period is generally considered as one of the most important time of your career. No matter what the reason is, it is crucial that you walk out of your workplace gracefully when it’s time to leave. Take a look at Six things that you must keep in mind while cruising through your notice period:
6 Things to do during your notice period:
Transition: It is always good to have a plan before you approach your boss. Despite the fact that you and your boss might have different approaches, it is always better to think about what might happen after you leave. It’s appreciative of your work ethics and principles.
Professionalism: You need to have a professional approach. Think twice before you speak. Never say things that you would regret in the future or might harm your career. Continue to maintain the same work ethics until you step out of your office for good. It is always better to leave on a good note.
Plan: Switching jobs is a major step in your career. It’s always good to have a plan before you move on from your current organization. This can help you handle stress in a better manner. Have a temporary plan for your finances, job requirements, commute, and other changes the new job might bring to your current lifestyle.
Resume: It’s always better to keep your resume updated. Also, remember to fill in details of different projects handled by you efficiently. During your notice period make time to pen down all your accomplishments in that organization that might be of your advantage in the corporate world.
Desk: Start clearing all your personal belongings from your desk. You don’t have to wait for the last day to carry the load of things.It’s always nice to clear your desk. This can help the other individual moving into your space can start fresh.
Certificate: Collect the Experience certificates/documents we have to get from our employer at the time of leaving.
This work is produced by Simplus Information Services Pvt Ltd. Customer engagement through content.
5 Things To Do During Your Notice Period
Wednesday, March 16, 2016
WhatsApp Added New Features March 2016
WhatsApp Tips and Tricks
WhatsApp has more than one billion monthly active users, making it one of the most popular apps in the world. The latest WhatsApp update has brought five new features to the messaging app, reports News Talk.First of all if you need all these features in your app, First you need to update the whatsapp latest version or Download the Latest version in Android Mobile.
WhatsApp new features include:
Documents: Users can now share documents and PDF files using third party apps like Google Docs, iCloud and DropBox.
Photos: The new enhanced photo sharing features allows users to share images from other apps. Within the app, users hit “Photo / Video Library” and selecting “choose from another app”.
Zoom: It’s now possible to zoom-in on videos, in the way many of us do on photos now.
Background: Users can now replace the standard background with an image or block color of your choice.
Storage: WhatsApp users have experienced storage issues in the past, stating the application uses too much space. Developers have responded to this and reduced the amount of space required to run the app.
Group Participants: In Group now we can add up 256 participants. So now onward you can connect all family and friends in single group itself. Before it was up to 100 participants only.
The ability to file share within WhatsApp is a positive step for the instant messaging service, giving business users more reason to remain with the application rather than e-mail.
WhatsApp announced earlier this year that they will stop supporting the BlackBerry 10 and Nokia platforms, as well as earlier versions of Android. So try use Android 5.0 version mobile now and Update your whatsApp regularly.WhatsApp Added New Features March 2016
How to send Documents in WhatsApp:
WhatsApp allows you to send documents to your contacts, just as you would send media, contacts or a location. Please keep in mind that WhatsApp only supports sending PDF files at this time.
Step by step to send documents in whatapps:
- The Sender and receiver of WhatsApp must be updated to latest version of WhatsApp .
- The version of Whatsapp must be above 2.12.500
- Open a chat
- Tap the Icon at the top of the screen
- Choose Document.
- Select the desired document to send and tap send in the popup.
WhatsApp Added New Features March 2016
Sunday, March 13, 2016
World’s largest umbrella in Grand Mosque Makkah
World’s largest umbrella being installed in Makkah Haram Soon
The Work started on Thursday for the installation of the world’s largest folding umbrella in the northern courtyard of the Grand Mosque in Makkah.
This is the first of the eight high-tech giant umbrellas and 54 small ones to be installed in the Grand Mosque in the coming six months.
Being manufactured in Germany, each canopy will consist of a giant clock, screens of guidelines for worshippers, air-conditioners, and surveillance cameras. Each umbrella will have a height of 45 meters and weigh 16 tons. It will give shade to an area of 2,400 square meters when open.
Some 25 engineers, specialist technicians, and safety experts from Germany will supervise the installation process and electronic operating mechanism. Another 54 small umbrellas will also be installed in the northern courtyard, covering a total area of 19,200 square meters. As part of the project, 122 benches for worshippers to take rest as well as service buildings will be built. The infrastructure work for the installation of canopies have already started.
The entire northern plaza stretching from King Fahd Expansion structure to the King Abdullah Expansion structure of the mosque will have canopies when the project is completed. The shaded area will have the capacity to accommodate around 400,000 worshippers.
The General Presidency for the Affairs of the Two Holy Mosques is supervising the project, in cooperation with specialists from the Ministry of Education and the contracting company, which is implementing the largest ever expansion of Islam’s holiest site.
In December 2014, a few weeks before his death, King Abdullah ordered the installation of umbrellas in the courtyards surrounding the Grand Mosque.
World’s largest umbrella in Grand Mosque Makkah
Sheikh Abdulrahman Al-Sudais, head of the presidency, announced then that the King’s order came to provide shading for external plazas, in addition to the areas approved in the King Abdullah Expansion project, with an additional area estimated at 275,000 square meters. More than 300 canopies will provide shade from the sun to the visitors of the Grand Mosque, he said.Nearly 250 similar umbrellas have been installed on the plazas around the Prophet’s Mosque in Madinah earlier. Like blooming flowers, the umbrellas are programmed to fold and unfold in minutely delayed sequence to avoid collision between their moving parts. Their near-silent operation is automatically aligned with changes in the daily temperature. They open each morning, creating a translucent ceiling, and retract each evening in less than three minutes.
In summer, the open umbrellas provide daytime shade and reflect away much of the sun’s radiant energy. When closed at night, they allow residual heat absorbed by the stone floors and walls to escape back into the atmosphere. The process is reversed in winter. When temperatures are relatively low, umbrellas are closed during the day to allow the winter sun to warm the site, and opened at night to retain heat near ground level.