Link to home
Start Free TrialLog in
Avatar of BOEING39
BOEING39

asked on

SYSTEM NETMAIL

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);
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of BOEING39
BOEING39

ASKER

Thx for the quick response