XPertMailer Home Page
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

BCC

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    XPertMailer Forum Index -> Help
View previous topic :: View next topic  
Author Message
alexmay



Joined: 13 Jun 2008
Posts: 3

PostPosted: Fri Jun 13, 2008 5:28 pm    Post subject: BCC Reply with quote

The documentation and the examples don't quite match up.
Well, they probably do, but only when you get VERY deep into the code.
I have managed to put the examples together and produce mails from a few inputs and send them via SMTP.
I wanted to add a BCC address. I can see that it should work, but I can't work out how.
Would some kind person look at what I have done and explain to me how to add the BCC address?
I would be extremely grateful and I imagine I won't be the only person who would benefit from the help.
Best regards,
Alex May

Code:

require_once 'SMTP.php';

function mymailer ($from, $to, $subj, $text, $html) {

$relay = 'auth.smtp.1and1.co.uk';
$user = (username removed);
$pass = (password removed);
$port = 25;

// set text/plain version of message
$msg1 = MIME::message($text, 'text/plain');
// set text/html version of message
$msg2 = MIME::message($html, 'text/html');
// compose message in MIME format
$mess = MIME::compose($msg1, $msg2);
// standard mail message RFC2822
$body = 'From: '.$from."\r\n".
                'To: '.$to."\r\n".
                'Subject: '.$subj."\r\n".
                $mess['header']."\r\n\r\n".
                $mess['content'];

$c = SMTP::connect($relay, $port, $user, $pass ) or die(print_r($_RESULT));

// send mail relay
$s = SMTP::send($c, array($to), $body, $from);

// print result
if ($s) {
// echo 'Sent !';
}else{
 print_r($_RESULT);
}
// disconnect
SMTP::disconnect($c);

}

_________________
XPertMailer - Advanced Mail Engine
Back to top
View user's profile Send private message Visit poster's website
admin
Site Admin


Joined: 14 Aug 2007
Posts: 139

PostPosted: Sat Jun 14, 2008 5:35 pm    Post subject: Reply with quote

For Bcc you will need to use MAIL class function AddBcc().
Code:
require_once '/path/MAIL.php';
$m = new MAIL;
$m->AddBcc('user1@domain1.net');
$m->AddBcc('user2@domain2.net');

More info about Bcc in MAIL Class: http://www.xpertmailer.com/documentation/mail/addbcc.html
You have examples how to use MAIL Class in XPertMailer v4 download package, see "EXAMPLES" folder.
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
snappy



Joined: 05 Mar 2009
Posts: 1

PostPosted: Thu Mar 05, 2009 7:26 am    Post subject: Reply with quote

Please explain how to use AddBcc('user1@domain1.net'); with the original posted example. If you can't then how do you accomplish the same thing as that example using the MAIL class? So far I the only way I have been able to sucessfully use xpertmailer is using MIME and SMTP. I am sending different messages containing images,html & text to different email addresses through a single SMTP authenticated connection. The MAIL class is confusing because when I create a connection and add attachements, Bccs, Tos, etc... send the message, then create a new message through the same connection it seems like I have to clear all that stuff first? Seems strange to me. The example code in referenced in this question seems more useable than using the MAIL class for this but I do need a BCC.
_________________
XPertMailer - Advanced Mail Engine
Back to top
View user's profile Send private message Visit poster's website
admin
Site Admin


Joined: 14 Aug 2007
Posts: 139

PostPosted: Tue Mar 10, 2009 10:10 am    Post subject: Reply with quote

Code:
$bcc = array('user1@mail1.com', 'user2@mail2.net', 'user3@mail3.org');
$s = SMTP::send($c, $bcc, $body, $from);

_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    XPertMailer Forum Index -> Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group