Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Help] help with sending e-mail in C#

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Thu May 29, 2008 12:27 pm    Post subject: [Help] help with sending e-mail in C# Reply with quote

i saw a vb source of a program that sends emails and i tried to convert it to C#
but i keep getting the failed message, i cant see what's wrong here?
Code:

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string host = String.Empty;
                host = "SMTP.gmail.com";
                MailMessage Mail = new MailMessage();
                Mail.To.Add(To.Text);
                Mail.From = new MailAddress(From.Text);
                Mail.Subject = "lol";
                Mail.Body = input.Text;
                SmtpClient SMTP = new SmtpClient(host);
                SMTP.Port = 587;
                SMTP.Host = host;
                SMTP.EnableSsl = true;
                SMTP.Send(Mail);
                SMTP = null;
                Mail.Dispose();
                MessageBox.Show("Success");
            }
            catch
            {
                MessageBox.Show("Failed");
            }
        }


btw i found an email sending class that was written by microsoft at msdn and it didnt worked for me either :\

EDIT:
i found out what's wrong
i need to use the
Code:

SMTP.Credentials = new System.Net.NetworkCredential(User.Text, Pass.Text);

but what if i dont want to use it ?
just to use "from" email and "To" email how can i do it?

_________________
Stylo
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Thu May 29, 2008 12:49 pm    Post subject: Reply with quote

try putting

Code:

catch( Exception e )
{
       MessageBox.Show( e.Message );
}


I think that's right, it should show you the real error message.
Back to top
View user's profile Send private message MSN Messenger
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Thu May 29, 2008 12:56 pm    Post subject: Reply with quote

yea i think i was right it's the user/pass information
view attachment



er.JPG
 Description:
error
 Filesize:  15.53 KB
 Viewed:  3674 Time(s)

er.JPG



_________________
Stylo
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Thu May 29, 2008 2:09 pm    Post subject: Reply with quote

( About the exception: I usually like to just put e.ToString() )

Anyways,

You should Google for using GMail as your host, it's usually pretty easy to use.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites