Solved

System.Net.Mail issue in VS 2005

Posted on 2007-03-30
1
129 Views
Last Modified: 2013-11-26
HI,

I have Imports System.Web.Mail in 2003. Now when I migrated to VS 2005, I changed this to System.Net.Mail.
But now I find that in 2003, I can set the value to Message.To as  Message.To = strReceiversEmail

But in Vs 2005, this statement gives me error as Message.To is read-only. Then how do I assign value to .To i.e. the receivers' email address?

Regards,
MI
0
Comment
Question by:vj_mi
[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
1 Comment
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 18824769
Hi vj_mi;

Like this
        ' sender and recipient are strings / e-mail address in below code.
        Dim fromAddress As New MailAddress(sender)
        Dim toAddress As New MailAddress(recipient)
        Dim message As New MailMessage(fromAddress, toAddress)

Fernando
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

736 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