Page 2 of 3

Re: How to email a simple plain text on windows form application

Posted: Wed Jun 22, 2011 10:26 pm
by mandai
localhost is just an example. You need to fill out the hostname of a valid SMTP server. Check with your mail provider for more information.

Re: How to email a simple plain text on windows form application

Posted: Wed Jun 22, 2011 10:36 pm
by emreozpalamutcu
It kind of worked but i think it's the settings of my domain just to make sure can you check this error

An unhandled exception of type 'System.Net.Mail.SmtpException' occurred in System.dll

Additional information: Mailbox unavailable. The server response was: Access denied - Invalid HELO name (See RFC2821 4.1.1.1)

Re: How to email a simple plain text on windows form application

Posted: Wed Jun 22, 2011 10:44 pm
by Snyper345
emreozpalamutcu wrote:
It kind of worked but i think it's the settings of my domain just to make sure can you check this error

An unhandled exception of type 'System.Net.Mail.SmtpException' occurred in System.dll

Additional information: Mailbox unavailable. The server response was: Access denied - Invalid HELO name (See RFC2821 4.1.1.1)

try smtp.live.com as your host

Re: How to email a simple plain text on windows form application

Posted: Wed Jun 22, 2011 10:50 pm
by emreozpalamutcu
now i get this error

An unhandled exception of type 'System.Net.Mail.SmtpException' occurred in System.dll

Additional information: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first

Re: How to email a simple plain text on windows form application

Posted: Wed Jun 22, 2011 10:52 pm
by mandai
This error means the SMTP server that you are using requires authentication.
You can enter your username/password details with this code.
Code: Select all
sc->Credentials = gcnew System::Net::NetworkCredential("user", "pass");
You may also need to set sc->EnableSsl to true.
Once again, check with your mail provider as they can tell you what the right security settings will be.

Re: How to email a simple plain text on windows form application

Posted: Wed Jun 22, 2011 10:59 pm
by Snyper345
yeah ssl is required for the live smpt server same with tls

Re: How to email a simple plain text on windows form application

Posted: Wed Jun 22, 2011 11:00 pm
by emreozpalamutcu
sorry can you just explain that you mean I have to have security, authentication ?

Re: How to email a simple plain text on windows form application

Posted: Wed Jun 22, 2011 11:06 pm
by Snyper345
emreozpalamutcu wrote:
sorry can you just explain that you mean I have to have security, authentication ?
for smpt.live.com you will to enter a username(email) and password for authentication but you need a registered email if you do not just go to http://urlm.in/ibsg , sorry had to shrink url it was too long

Re: How to email a simple plain text on windows form application

Posted: Wed Jun 22, 2011 11:08 pm
by mandai
In order to connect to certain SMTP servers you will need a user name and password (usually given when you register an account with the provider). Without authentication anyone could use the server to send spam emails.

Re: How to email a simple plain text on windows form application

Posted: Wed Jun 22, 2011 11:11 pm
by emreozpalamutcu
Okay but I don't want to ask the users who is using my program for there authentication and how could I do this can I just use my details to send the messages to my support email if yes what is the code for it

thank you