Solved

SMTP CC & BCC (Telnet like application)

Posted on 2006-06-14
5
9,418 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:gRoberts12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 43

Accepted Solution

by:
Steve Knight earned 250 total points
ID: 16901255
That is the way it works. rcpt to is the actual recipients to, cc, or bcc regardless.  what shows in the headers part is just text and pretty well irrelevant,don't specify the bcc there at all and the to entrywill be seen by all and doesn't have to be a real recipient listed in rcpt to.

0
 
LVL 1

Author Comment

by:gRoberts12
ID: 16901399
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
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16901509
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.
0
 
LVL 1

Author Comment

by:gRoberts12
ID: 16901542
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
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 16901567
no problem...
Steve
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
NFS v4 7 75
Printer Access denied on reboot 5 89
Samples DNS record setting. 5 54
Cisco 2504 Wireless LAN Controller and Network Folder no showing computers 8 9
Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question