FestePlatte
5 years ago
Hi all,

I'm using EAsendmail in VB6/Windows 7. I'm trying to generate a mail which includes a BCC address.

The following code
________________________________________________________
Dim oSmtp As New EASendMailObjLib.Mail
oSmtp.From = "SenderName"
oSmtp.FromAddr = ""
oSmtp.AddRecipientEx "recipient@rec.com", 0
oSmtp.AddRecipientEx "cc@test.com", 1
oSmtp.AddRecipientEx "bcc@test.com", 2
oSmtp.Subject = "BCC test"
oSmtp.BodyText = "This mail is to test BCC"
oSmtp.SaveMail ("D:\test.txt")
________________________________________________________

produces the following mail file:

________________________________________________________
Message-ID: <99c9a10680a23afbea0ddf1d001e93a2@test.com>
From: "SenderName"
To:
Cc:
Subject: BCC test
Date: Thu, 12 Dec 2019 12:27:06 +0100
MIME-Version: 1.0
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable

This mail is to test BCC
________________________________________________________

The BCC address is missing!

What is wrong here?

Any answer appreciated.

Kind regards,
FestePlatte
ivan
  • ivan
  • 100% (Exalted)
  • Administration
5 years ago
Hi, Bcc header won't be added to message, but if you call SendMail method, the Bcc recipient will be sent to server.

If you want a Bcc header, you can use

oSmtp.AddHeader "Bcc", "bcc@test.com"
FestePlatte
5 years ago
Hi ivan,

thank you very much for this hint. That should work fine!

Best regards,
FestePlatte
FestePlatte
5 years ago


If you want a Bcc header, you can use
oSmtp.AddHeader "Bcc", "bcc@test.com"

Originally Posted by: ivan 



Hi Ivan,

if I do so, the BCC header is added as the first header entry, bevor any other header. Will that work?

Best regards,
Feste Platte
ivan
  • ivan
  • 100% (Exalted)
  • Administration
5 years ago


If you want a Bcc header, you can use
oSmtp.AddHeader "Bcc", "bcc@test.com"

Originally Posted by: FestePlatte 



Hi Ivan,

if I do so, the BCC header is added as the first header entry, bevor any other header. Will that work?

Best regards,
Feste Platte

Originally Posted by: ivan 



Yes it will work, but EASendMail has a known issue with Bcc header, if you used AddHeader with Bcc, there is only bcc header added, but if you call SendMail method, the recipient in bcc header won't be sent,

However if you used
AddRecipient "bcc", "bcc@domain", 2

AddHeader "Bcc", "bcc@domain" will not work.

In SMTP protocol, Bcc header should be removed, could you tell me why you need bcc header in message?



FestePlatte
5 years ago
Hi Ivan,

[quote=FestePlatte;4731][quote=ivan;4707]

Could you tell me why you need bcc header in message?

Originally Posted by: ivan 



When reloading a mail which has been sent before I want to see if it has been sent to one or more BCC addresses. Ok, I'll use the "flag=2" method and shall store the BCC data separately in my mail database.

Thanks again for your great support!
Feste Platte

EXPLORE TUTORIALS

© All Rights Reserved, AIFEI Software Limited & AdminSystem Software Limited.