Click here to Skip to main content
15,914,165 members
Home / Discussions / C#
   

C#

 
QuestionExtracting from a list. Pin
nlowdon27-Nov-08 4:04
nlowdon27-Nov-08 4:04 
AnswerRe: Extracting from a list. Pin
J4amieC27-Nov-08 4:13
J4amieC27-Nov-08 4:13 
GeneralRe: Extracting from a list. Pin
nlowdon27-Nov-08 4:55
nlowdon27-Nov-08 4:55 
GeneralRe: Extracting from a list. Pin
Malcolm Smart27-Nov-08 6:37
Malcolm Smart27-Nov-08 6:37 
GeneralRe: Extracting from a list. Pin
User 665827-Nov-08 7:07
User 665827-Nov-08 7:07 
QuestionHow to handle the memory Corruption Exception in .Net using C# Pin
abbineni.pavithra27-Nov-08 3:33
abbineni.pavithra27-Nov-08 3:33 
Questionproblem in using VC++ DLL functions in C#.net Pin
kimo_cs27-Nov-08 3:32
kimo_cs27-Nov-08 3:32 
QuestionHow to Send email via gmail smtp server Pin
shovaly27-Nov-08 3:30
shovaly27-Nov-08 3:30 
I was able to send mail via simple smtp server
the problem is that as i understood gmail needs ssl authentication.
this is my code but it fails with the following message :
530 5.7.0 Must issue a STARTTLS command first
btw this project is done in vs2003 so im using only System.Net.Sockets and I cant use System.Net.Mail

mailSubject = ModifyMailContent(mailSubject);
mailBody = ModifyMailContent(mailBody);
int code;		
using(TcpClient smtpSocket = new TcpClient(smtpServer, mailServerPort))
using(NetworkStream ns = smtpSocket.GetStream())
{
				// get response from Smtp server
				code = GetSmtpResponse(ReadBuffer(ns));
				
				// EHLO
				WriteBuffer(ns, "ehlo\r\n");
				// get response from Smtp server
				string buffer = ReadBuffer(ns);
				code = GetSmtpResponse(buffer);
				
				// check for AUTH=LOGIN
				if(buffer.IndexOf("AUTH=LOGIN") >= 0)
				{
					// AUTH LOGIN
					WriteBuffer(ns, "auth login\r\n");
					
					code = GetSmtpResponse(ReadBuffer(ns));
					
					// username:
					WriteBuffer(ns, System.Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes(username)) + "\r\n");
					
					code = GetSmtpResponse(ReadBuffer(ns));
					
					// password:
					WriteBuffer(ns, System.Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes(password)) + "\r\n");
					
					code = GetSmtpResponse(ReadBuffer(ns));
					
				}
				// MAIL FROM:
				WriteBuffer(ns, "mail from: <" + mailSender + ">\r\n");
				code = GetSmtpResponse(ReadBuffer(ns));
				
				// RCPT TO:
				string[] splitRecipient = mailRecipient.Split(',');
				foreach(string sEmailTo in splitRecipient)
				{
					WriteBuffer(ns, "rcpt to:<" + sEmailTo + ">\r\n");
					code = GetSmtpResponse(ReadBuffer(ns));
					
				}
				// DATA
				WriteBuffer(ns, "data\r\n");
				code = GetSmtpResponse(ReadBuffer(ns));
				
				// Repeat the from and to addresses in the data section
				WriteBuffer(ns, "from:<" + mailSender + ">\r\n");
				foreach(string sEmailTo in splitRecipient)
				{
					WriteBuffer(ns, "to:<" + sEmailTo + ">\r\n");
				}
				WriteBuffer(ns, "Subject:" + mailSubject + "\r\n");
				
				// send message
				WriteBuffer(ns, "\r\n" + mailBody + "\r\n.\r\n");
				code = GetSmtpResponse(ReadBuffer(ns));
				
				WriteBuffer(ns, "quit\r\n");

}

Questionadding a trackbar into a menustrip? Pin
lane0p227-Nov-08 2:57
lane0p227-Nov-08 2:57 
AnswerRe: adding a trackbar into a menustrip? Pin
Abhijit Jana27-Nov-08 3:22
professionalAbhijit Jana27-Nov-08 3:22 
GeneralRe: adding a trackbar into a menustrip? Pin
lane0p227-Nov-08 3:33
lane0p227-Nov-08 3:33 
GeneralRe: adding a trackbar into a menustrip? Pin
Abhijit Jana27-Nov-08 4:46
professionalAbhijit Jana27-Nov-08 4:46 
QuestionASF Files Pin
dotman127-Nov-08 2:57
dotman127-Nov-08 2:57 
Questioncustomizing crystal reports Pin
harcaype27-Nov-08 2:55
harcaype27-Nov-08 2:55 
AnswerRe: customizing crystal reports Pin
Eddy Vluggen27-Nov-08 4:37
professionalEddy Vluggen27-Nov-08 4:37 
GeneralRe: customizing crystal reports Pin
harcaype28-Nov-08 13:40
harcaype28-Nov-08 13:40 
QuestionMaking a class public Pin
Thekaninos27-Nov-08 2:32
Thekaninos27-Nov-08 2:32 
AnswerRe: Making a class public Pin
Simon P Stevens27-Nov-08 2:53
Simon P Stevens27-Nov-08 2:53 
GeneralRe: Making a class public [modified] Pin
Thekaninos27-Nov-08 3:14
Thekaninos27-Nov-08 3:14 
GeneralRe: Making a class public Pin
Simon P Stevens27-Nov-08 3:24
Simon P Stevens27-Nov-08 3:24 
AnswerRe: Making a class public Pin
PIEBALDconsult27-Nov-08 4:10
mvePIEBALDconsult27-Nov-08 4:10 
QuestionLetter Combination Pin
Silvyster27-Nov-08 2:01
Silvyster27-Nov-08 2:01 
AnswerRe: Letter Combination Pin
Simon P Stevens27-Nov-08 3:12
Simon P Stevens27-Nov-08 3:12 
AnswerRe: Letter Combination Pin
Guffa27-Nov-08 3:20
Guffa27-Nov-08 3:20 
QuestionWhy doesnt this function for controls objects work? [modified] Pin
Matjaz-xyz27-Nov-08 1:45
Matjaz-xyz27-Nov-08 1:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.