473,387 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Get No "Mail From" in the TcpClient

Hi,

In my C# Windows form project, I can receieve the mail from the C# code,
however, it's EMPTY in the MAIL FROM:
Would someone give me some advice?

string Data;
byte[] szData;

TcpClient SmtpServ = new TcpClient(ServSMTP.Text,25);
NetworkStream NetStrm = SmtpServ.GetStream();
StreamReader RdStrm= new StreamReader(SmtpServ.GetStream());
Data = "RCPT TO: " + "<" + txtTo.Text + ">" + CRLF;

szData = System.Text.Encoding.Default.GetBytes(Data.ToCharA rray());
NetStrm.Write(szData,0,szData.Length);
Thanks for help!

Jason


Jan 24 '07 #1
3 2221
With what you have posted, why would you expect to.

That looks like incomplete code for an SMTP Client, not an SMTP Server.
"Jason Huang" <Ja************@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Hi,

In my C# Windows form project, I can receieve the mail from the C# code,
however, it's EMPTY in the MAIL FROM:
Would someone give me some advice?

string Data;
byte[] szData;

TcpClient SmtpServ = new TcpClient(ServSMTP.Text,25);
NetworkStream NetStrm = SmtpServ.GetStream();
StreamReader RdStrm= new StreamReader(SmtpServ.GetStream());
Data = "RCPT TO: " + "<" + txtTo.Text + ">" + CRLF;

szData = System.Text.Encoding.Default.GetBytes(Data.ToCharA rray());
NetStrm.Write(szData,0,szData.Length);
Thanks for help!

Jason


Jan 24 '07 #2

SMTP session

S: greeting text
C: EHLO
S: OK
C: mail from: <>
S: response
C: RCPT TO:: <>
S: response
C: data
S: response
C: sends data
S: response
C: quit
S: response

Thas normal smtp sessiosn what you must follow, most server won't allow RCPT
TO: before all steps before it done.

Probably for you is to use some smtp client.

"Jason Huang" <Ja************@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Hi,

In my C# Windows form project, I can receieve the mail from the C# code,
however, it's EMPTY in the MAIL FROM:
Would someone give me some advice?

string Data;
byte[] szData;

TcpClient SmtpServ = new TcpClient(ServSMTP.Text,25);
NetworkStream NetStrm = SmtpServ.GetStream();
StreamReader RdStrm= new StreamReader(SmtpServ.GetStream());
Data = "RCPT TO: " + "<" + txtTo.Text + ">" + CRLF;

szData = System.Text.Encoding.Default.GetBytes(Data.ToCharA rray());
NetStrm.Write(szData,0,szData.Length);
Thanks for help!

Jason


Jan 24 '07 #3
Hi,

most probably you are not implementing the protocol correctly,
My suggestions are:
1- Simple use the class provided by the framework
2- Download some free smtp client from the net
--
Ignacio Machin
machin AT laceupsolutions com
Jan 24 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Kevin | last post by:
Hi all, This may not be a PHP issue, but I was hoping someone might know where to look. I have a web app that a client purchased which sends an email using PHP's "mail" function. If it sends a...
0
by: AvMailGate | last post by:
* * * * * * * * * * * * * * * AntiVir ALERT * * * * * * * * * * * * * * * This version of AntiVir is licensed and full featured. AntiVir has detected the following in a mail from your address: ...
0
by: Vexira | last post by:
* * * * * * * * * * * * * * * Vexira ALERT * * * * * * * * * * * * * * * This version of Vexira MailArmor is licensed and full featured. Vexira has detected the following in a mail from your...
4
by: manatlan | last post by:
In an intranet/lan, i'd like to put a "python server script" (which run forever) on a computer A... On another computer B, I'd like to send smtp-email to the computer A ... (send to...
3
by: HoustonComputerGuy | last post by:
I am working on getting my web applications moved to .Net 2.0 and am having some problems with System.Net.Mail. I get the following error when sending the mail: System.Net.Mail.SmtpException was...
6
by: Kurda Yon | last post by:
Hi everybody, I have a problem with the function "mail". It returns "true" but supposed recipients receive nothing. My code is as follows: $to = $form; $subject = "E-mail Verification";...
1
by: vps | last post by:
I have Apache 2.2 server running on Windows XP SP2 with PHP 5.2.5. I have run go-pear.bat in PHP directory (system-wide, all defaults). Running “pear” command lists additional commands. I...
1
by: =?Utf-8?B?VGFsYWxTYWxlZW0=?= | last post by:
i have facility in my website which sends an e-mail to the cleint's inbox..... i am getting a problem when ever i sends an e-mail.. i tried with Hotmail and Yahoo, e-mail goes to the "Junk Mail"...
3
by: Evan | last post by:
Hello - I'm new with Python, I try to do a mail problem, the code likes below: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ import smtplib import mimetypes from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.