Solved

SYSTEM NETMAIL

Posted on 2012-12-24
3
285 Views
Last Modified: 2012-12-24
The following code was being utilized with a form for which after submittal it would send out an e-mail.   I recently changed host services and now it appears that I need to incorperate the host server credentials ie "Name and Password" to function.   Referencing the code below I am gettting a line error @ (SmtpClient.Credentials) stating an object reference is required or property 'System.NetMail.Smtp.Client.Credentials.get'


        AlternateView htmlView = AlternateView.CreateAlternateViewFromString(htmlBody, null, "text/html");
        message.AlternateViews.Add(plainView);
        message.AlternateViews.Add(htmlView);
        message.Priority = MailPriority.High;
        smtpClient.Host = "server.net ";
        SmtpClient.Credentials = new NetworkCredential("support@namannassar.com", "passcode");
        smtpClient.Send(message);
0
Comment
Question by:BOEING39
[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
3 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 38719141
Change the capital "S" to a lowercase "s":

smtpClient.Credentials = new NetworkCredential("support@namannassar.com", "passcode");

Open in new window

0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 38719145
P.S.

It is situations like this where it is highly advisable to not name your variables the same name as the class you are instantiating (save for a change of casing). Subtle errors like these can crop up, and--depending on the scenario--could be much more harmful.
0
 

Author Closing Comment

by:BOEING39
ID: 38719151
Thx for the quick response
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 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