?
Solved

VB.Net   -   Send Email

Posted on 2006-11-16
4
Medium Priority
?
487 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

771 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