[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

VB.Net   -   Send Email

Posted on 2006-11-16
4
Medium Priority
?
490 Views
Last Modified: 2008-02-26
VB.Net DeskTop Application
-------------------------------

I want to send Email   from  my DeskTop  Application (developed in VB.Net).

How can i do this. pls give some idea   or  code.
0
Comment
Question by:sohrabus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 6

Expert Comment

by:bigphuckinglizard
ID: 17956271
you need to import the namespace System.Web.Mail

Dim Mail As New MailMessage(), strBody as String = ""
strBody &= "Hello" & vbcrlf
strBody &= "Goodbye"
With Mail
 .To = "you@whereyouare.com"
 .From = "me@whereiam.com"
 .Subject="Greetings!"
 .Body = strBody
End With      
SmtpMail.SmtpServer = "mail.yourdomain.com"
SmtpMail.Send(mail)
0
 

Author Comment

by:sohrabus
ID: 17962694
First , I would like to let u know that
System.Web.Mail          Namespace is not available in VB.Net DeskTop

This namespace is available when making appl. for web.
0
 
LVL 6

Accepted Solution

by:
bigphuckinglizard earned 375 total points
ID: 17963415
you need to go to project->add reference. whether it's a desktop or web application has no bearing on what namespaces are usable
0
 

Author Comment

by:sohrabus
ID: 17963751
Dear,

Thanks alot.

Ur code works fine.
I added reference   system.web.dll  and then imports namespace
system.web.mail.

Everything works fine.

Thanks,
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question