|
-
Sep 8th, 2006, 07:16 AM
#1
Thread Starter
Hyperactive Member
Send Mail Using C#
I cant do this..
I have this code:
Code:
static void Main(string[] args)
{
MailMessage mailMsg = new MailMessage();
mailMsg .From = "[email protected]";
mailMsg .To = "[email protected]";
mailMsg .Cc = "[email protected]";
mailMsg .Bcc = "[email protected]";
mailMsg .Subject = "SubjectOfTheMailString";
mailMsg .Body = "BodyOfTheMailString";
smtpmail .Send(mailMsg);
Console.ReadKey();
}
And every line is an error.. Why?
506C65617365205261746520506F7374732E2E2E
-
Sep 8th, 2006, 08:14 AM
#2
Re: Send Mail Using C#
you should declare the "smtpmail" object and use your mail server
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Sep 8th, 2006, 08:18 AM
#3
Re: Send Mail Using C#
Every line is an error? What error? If we don't know what the errors are we can't tell you what the errors are. Chances are you have added the required reference and/or import to your project. You haven't told us what version you're using so we don't know whether to advise you to use System.Web.Mail or System.Net.Mail. Please always specify your version when posting a question and always give details of errors. Otherwise we have to guess.
-
Sep 8th, 2006, 09:31 AM
#4
Re: Send Mail Using C#
My guess is, you're trying to use that C# code in a VB.NET application. That would be perfectly plausible since every line is an error.
-
Sep 8th, 2006, 09:35 AM
#5
Re: Send Mail Using C#
Remove the space before the dynamic member access operator on each line.
-
Sep 8th, 2006, 09:41 AM
#6
Re: Send Mail Using C#
D'oh.
D'ohest thing ever.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|