Heres an interesting free snippet of code I just used to send mail from my .n... http://www.osix.net/modules/article/?id=513
Welcome, you are an anonymous user! [register] [login] Get a yourname@osix.net email address
Geek Reverser
View Solutions
Test Centre
Mau Ke Luar Angkasa ?
Hall of Brain www.axeapollo.co.id
Hall of Bonus Tinggal Hari Ini Kesempatan Lo Bisa Pergi Ke Luar Angkasa Sob. Buruan!
Hall of
Reverse The article including the code is here
Geek or Freak
The code library is here
User's box And just to fill up our database and think12's quotas .. here is the code
Username: using System;
using System.Text;
Password: using System.IO;
using System.Net.Sockets;
using System.Net;
using System.Web.Mail;
namespace SMTP
Forgot
{
password?
/// <summary>
New account /// provides methods to send email via smtp direct to mail server
/// </summary>
Shoutbox public class SmtpDirect
{
MaxMouse
/// <summary>
It's Friday... /// Get / Set the name of the SMTP mail server
That's good /// </summary>
enough for me! public static string SmtpServer;
CodeX private enum SMTPResponse: int
non stop lolz {
here but thats CONNECT_SUCCESS = 220,
soon to end GENERIC_SUCCESS = 250,
thanks to uni, DATA_SUCCESS = 354,
surely the rest QUIT_SUCCESS = 221
}
of the world is
public static bool Send(MailMessage message)
going good?
{
stabat
IPHostEntry IPhst = Dns.Resolve(SmtpServer);
how things are IPEndPoint endPt = new IPEndPoint(IPhst.AddressList[0], 25);
going guys? Socket s= new Socket(endPt.AddressFamily, SocketType.Stream,ProtocolType.Tcp);
Here... s.Connect(endPt);
boring...
CodeX if(!Check_Response(s, SMTPResponse.CONNECT_SUCCESS))
I must be {
going wrong on s.Close();
the password return false;
lengths then, }
as long as it
Senddata(s, string.Format("HELO {0}rn", Dns.GetHostName() ));
was done on
if(!Check_Response(s, SMTPResponse.GENERIC_SUCCESS))
ECB {
MaxMouse s.Close();
lol... the key is return false;
in hex (MD5: }
of the string
"doit" without Senddata(s, string.Format("MAIL From: {0}rn", message.From ));
the "'s) and is if(!Check_Response(s, SMTPResponse.GENERIC_SUCCESS))
in lower case. {
Maybe i should
s.Close();
have
return false;
submitted this
}
as a challenge!
string _To = message.To;
Donate string[] Tos= _To.Split(new char[] {';'});
foreach (string To in Tos)
Donate and help {
us fund new Senddata(s, string.Format("RCPT TO: {0}rn", To));
challenges if(!Check_Response(s, SMTPResponse.GENERIC_SUCCESS))
{
s.Close();
return false;
Due Date: Sep 30
}
September
Goal:
$40.00 }
1 of 3 9/15/2013 10:50 AM
Sending Mail using C# - More mail sending code, and its not even mine! Heres an interesting free snippet of code I just used to send mail from my .n... http://www.osix.net/modules/article/?id=513
Senddata(s, ("DATArn"));
if(!Check_Response(s, SMTPResponse.DATA_SUCCESS))
{
s.Close();
return false;
}
Header.Append( "rn" );
Header.Append( MsgBody );
Header.Append( ".rn" );
Header.Append( "rn" );
Header.Append( "rn" );
Senddata(s, Header.ToString());
if(!Check_Response(s, SMTPResponse.GENERIC_SUCCESS ))
{
s.Close();
return false;
}
Senddata(s, "QUITrn");
Check_Response(s, SMTPResponse.QUIT_SUCCESS );
s.Close();
return true;
}
private static void Senddata(Socket s, string msg)
{
byte[] _msg = Encoding.ASCII.GetBytes(msg);
s.Send(_msg , 0, _msg .Length, SocketFlags.None);
}
private static bool Check_Response(Socket s, SMTPResponse response_expected )
{
string sResponse;
int response;
byte[] bytes = new byte[1024];
while (s.Available==0)
{
System.Threading.Thread.Sleep(100);
}
2 of 3 9/15/2013 10:50 AM
Sending Mail using C# - More mail sending code, and its not even mine! Heres an interesting free snippet of code I just used to send mail from my .n... http://www.osix.net/modules/article/?id=513
Comments:
bb oh, and if your writing a real system, dont bother using this - use OpenSmtp. A free C# mail library hosted on sourceforge.net
20 04-0 4-28
15 :10:09
Anonymous But what change has to be made to the above code, so that if I want to send my attachment as inline.
20 06-1 2-21
Help Needed.
07 :12:06 Thnx.
Anonymous hai
20 07-1 2-22
04 :17:48
BB Code is enabled.
Captcha Number:
bb ASP.NET RadioButton GroupName when inside a Repeater on Sun 10th Jun 8am
I was thankful on finding this nugget of code, which makes the groupname work out when slamming in radiobuttons in an asp.net repeater. http://www.codeguru.com/csharp/csharp/cs _controls/custom/article.php/c12371/
Your Ad Here
3 of 3 9/15/2013 10:50 AM