Link to home
Start Free TrialLog in
Avatar of gRoberts12
gRoberts12

asked on

SMTP CC & BCC (Telnet like application)

Hi all,

I'm working on a new SMTP class for the company I work for, as the one that comes packaged with .Net does not support certain features.

Now,

I've got everything working apart from the CC and BCC. It seems to work to an point but theres a little problem.

Within my class i've built-in a log method, which logs each request and response made to the SMTP server (via sockets).

heres my output:

New Log 14/06/2006

< : 220 mail.****.co.uk ESMTP Sendmail 8.10.2/8.10.2; Wed, 14 Jun 2006 08:15:30 +0100 : Wed, 14 Jun 2006 08:39:50 GMT
> : HELO ****: Wed, 14 Jun 2006 08:39:50 GMT
< : 250 mail.****.co.uk Hello [192.168.0.69], pleased to meet you : Wed, 14 Jun 2006 08:39:50 GMT
> : MAIL FROM: <root@****.co.uk> : Wed, 14 Jun 2006 08:39:50 GMT
< : 250 2.1.0 <root@****.co.uk>... Sender ok : Wed, 14 Jun 2006 08:39:50 GMT
> : RCPT TO: <Gavin@****.co.uk> : Wed, 14 Jun 2006 08:39:50 GMT
< : 250 2.1.5 <Gavin@****.co.uk>... Recipient ok : Wed, 14 Jun 2006 08:39:50 GMT
> : RCPT TO: <admin@****.co.uk> : Wed, 14 Jun 2006 08:39:50 GMT
< : 250 2.1.5 <admin@****.co.uk>... Recipient ok : Wed, 14 Jun 2006 08:39:50 GMT
> : DATA : Wed, 14 Jun 2006 08:39:50 GMT
< : 354 Please start mail input. : Wed, 14 Jun 2006 08:39:50 GMT
> : Subject: DSSMTP Test Message
MIME-Version: 1.0
Content-Type: multipart/mixed;
      boundary="----_=_NextPart_000_QZTMDYDNMT.GGYLTHBWJE"
Message-ID: <QZTMDYDNMT.GGYLTHBWJE@****.co.uk>
From: "Gavin @ Work" <root@****.co.uk>
To: "Gavin Roberts" <Gavin@****.co.uk>
Bcc: "Gavin @ Home" <admin@****.co.uk>

------_=_NextPart_000_QZTMDYDNMT.GGYLTHBWJE
Content-Type: text/plain;
      charset="iso-8859-1"

This is a test

Does it work?!

------_=_NextPart_000_QZTMDYDNMT.GGYLTHBWJE--


. : Wed, 14 Jun 2006 08:39:50 GMT
< : 250 Mail queued for delivery. : Wed, 14 Jun 2006 08:39:50 GMT
> : QUIT : Wed, 14 Jun 2006 08:39:50 GMT
< : 221 Closing connection. Good bye. : Wed, 14 Jun 2006 08:39:50 GMT

It seems that although I specified a name and e-mail address for the bcc recepient, it's some how managed to send both e-mails with the name and e-mail address of the To recepient.

** EDIT ** Both e-mails are received on the accounts sent to, it's just the sent to name appears the same for both e-mails (the e-mail address and name specified in the To: within the e-mail header).

And since there is no RCPT CC or RCPT BCC command in SMTP, I have been informed that you just set RCPT TO for all the e-mail addresses you want to send to, and then the e-mail header deals with the rest.

Just to let you know, both e-mails I receive have no idea that there are two recepients, just that one of the e-mails has the wrong name and e-mail address showing.

Does anyone know of why this is happening and how I can resolve this?!

It's pretty urgent so 250 points will go down quite nicely for anyone that can help solve this.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gRoberts12
gRoberts12

ASKER

I've just been reading a little more about, and well what you say is partially true, it still sends the e-mail as BCC but it keeps the main recepients e-mail address and name as the display name it was sent to.

I've adapted my script to send the e-mails to BCC recepients seperately, so i've pretty much sorted it.

I'll mark your reply as the answer.

Regards

Gav
that's what I was getting at. bcc just really means an entry in rcpt to but not normaly in the headers... everyone sees what goes in the headers, I.e. to and cc.  typing this on pda hence keeping it short.

not keen on b grades but thanks for the paq, an a doesn't cost any more you know.
apologies, the reason why I marked it as such is because I really answered my own question.

But out of kindness & as a Thank you for taking your time I gave you the points as well.

I was going to disbute the points, and ask for them back but I feel that's an insult against your self, as you took the time to deal with my question, although it wasn't a real solution, if I hadn't of figured it out before hand, your reply would of resulted in me resolving the issue.

If the points didn't say Thank You (enough or at all),

Thank you for your effort.

Regards

Gav
no problem...
Steve