Skip to Content Skip to Menu

SMTP mails don't works witj CB

  • bruno_c
  • bruno_c
  • OFFLINE
  • Posts: 24
  • Thanks: 2
  • Karma: 0
10 years 7 months ago #242331 by bruno_c
Replied by bruno_c on topic SMTP mails don't works with CB
Hello,
Yes i need an external SMTP server because my host mail server is shared and some mails take between one minute to half a day to be delivered.
I installed cmandril to control sending my emails and to be sure that they are well sent.
Bruno

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 7 months ago #242332 by krileon
Replied by krileon on topic SMTP mails don't works with CB
We have no integration with cmandril. So I have no idea if it's going to work with CB or not. I've tested CB SMTP usage using GMail and it appears to be working fine still. Sorry, I've no experience with cmandril so I don't know what further to suggest. You may need to modify CBs mailer function to construct a Joomla mailer instead of using CB mailer API if you want cmandril to handle the emails.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • bruno_c
  • bruno_c
  • OFFLINE
  • Posts: 24
  • Thanks: 2
  • Karma: 0
10 years 7 months ago - 10 years 7 months ago #242338 by bruno_c
Replied by bruno_c on topic SMTP mails don't works with CB
Thank you,
I am a beginer and i don't know how to start, i go look the two mailer functions and try it. Can you give me an outline or the main guidelines for this?
However, i go to test with gmail as your first reply to be sure it's not a default of my site.
But, i don't understand why it works on my localhost and not on my hosting.
I try it tomorrow and i keep you informed.
I just try with gmail on my site, it works on joomla mass mailing but not with CB mailing, so i think i have to reload the CB php files in a first step.
Best Regards,
Bruno
Last edit: 10 years 7 months ago by bruno_c. Reason: testing gmail solution

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 7 months ago #242369 by krileon
Replied by krileon on topic SMTP mails don't works with CB
You need to modify the below function in the below file.

IN: administrator/components/com_comprofiler/comprofiler.class.php
FUNCTION: comprofilerCreateMail

Beyond that I can't advise you any further as we do not support core edits. I also do not know the needs of cmandril.

But, i don't understand why it works on my localhost and not on my hosting.

I don't know either. That would imply some sort of hosting issue.

I just try with gmail on my site, it works on joomla mass mailing but not with CB mailing, so i think i have to reload the CB php files in a first step.

Did you configure the GMail usage exactly as instructed in the below topic?

www.joomlapolis.com/forum/153-professional-member-support/221671-cannot-receive-registration-e-mails?start=24#229809

Does GMail also work on your localhost fine?


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • bruno_c
  • bruno_c
  • OFFLINE
  • Posts: 24
  • Thanks: 2
  • Karma: 0
10 years 7 months ago - 10 years 7 months ago #242443 by bruno_c
Replied by bruno_c on topic SMTP mails don't works with CB
Hello,
Thank for your reply.
Following, the result of a community builder->users->message which does not work for analyse and the modifications i have done to the function comprofilerCreateMail which works fine. Maybe the problem comes to the $smtpport variable.
Best regards,
Bruno

in the function comprofilerMail, just before the line $mailsSent = $mail->Send();
I have added this line :
echo "<br/><br/>SEND MAIL FUNCTION:<br/> from: ". $from."<br/>fromname: ".$fromname."<br/> subject: ". $subject."<br/>body: ".$body."<br/>subject: ".$subject."<br/>mode: ".$mode."<br/>"; print_r($mail);
and there is the result : (i have change the e-mail adress by "my valid adress mail" and my password (cmandril API key)by xxxxxxxxx).

<br/>SEND MAIL FUNCTION:<br/>
from: octrier@octrier.com

fromname: Enregistrement Utilisateur Octrier<br/>
subject: octrier - test<br/>
body: <p>admin CB</p><br/>
subject: octrier - test<br/>
mode: 1<br/>
CBPHPMailer Object (
[Priority] => 3
[CharSet] => UTF-8
[ContentType] => text/html
[Encoding] => 8bit
[ErrorInfo] => [From] => octrier@octrier.com
[FromName] => Enregistrement Utilisateur Octrier
[Sender] => octrier@octrier.com
[Subject] => octrier - test
[Body] => <p>admin CB</p>
[AltBody] => [MIMEBody:protected] => [MIMEHeader:protected] => [WordWrap] => 0
[Mailer] => smtp [Sendmail] => <span>/</span>usr<span>/</span>sbin/sendmail
[PluginDir] => /my home site.../html/administrator/components/com_comprofiler/library/phpmailer/
[ConfirmReadingTo] => [Hostname] => [MessageID] => [Host] => smtp.mandrillapp.com [Port] => 587
[Helo] => [SMTPSecure] => ssl [SMTPAuth] => 1 [Username] => my mandril username
[Password] => xxxxxxxxx(Cmandril API key)
[Timeout] => 10
[SMTPDebug] => [SMTPKeepAlive] => [SingleTo] => [SingleToArray] => Array ( )
[LE] => [DKIM_selector] => phpmailer
[DKIM_identity] => [DKIM_passphrase] => [DKIM_domain] => [DKIM_private] => [action_function] => [Version] => 5.2
[XMailer] => [smtp] => [to:protected] => Array ( [0] => Array ( [0] => my valid adress mail [1] => ) )
[cc:protected] => Array ( )
[bcc:protected] => Array ( )
[ReplyTo:protected] => Array ( [admin.octrier@octrier.org] => Array ( [0] => admin.octrier@octrier.org [1] => Enregistrement Utilisateur Octrier ) )
[all_recipients:protected] => Array ( [my valid ardress mail] => 1 )
[attachment:protected] => Array ( ) [CustomHeader:protected] => Array ( )
[message_type:protected] => [boundary:protected] => Array ( ) [language:protected] => Array ( [provide_address] => You must provide at least one recipient email address.
[mailer_not_supported] => mailer is not supported.
[execute] => Could not execute:
[instantiate] => Could not instantiate mail function.
[authenticate] => SMTP Error: Could not authenticate.
[from_failed] => The following From address failed:
[recipients_failed] => SMTP Error: The following recipients failed:
[data_not_accepted] => SMTP Error: Data not accepted.
[connect_host] => SMTP Error: Could not connect to SMTP host.
[file_access] => Could not access file: [file_open] => File Error: Could not open file:
[encoding] => Unknown encoding: [signing] => Signing Error:
[smtp_error] => SMTP server error:
[empty_message] => Message body empty
[invalid_address] => Invalid address
[variable_set] => Cannot set or reset variable: )
[error_count:protected] => 0
[sign_cert_file:protected] => [sign_key_file:protected] => [sign_key_pass:protected] => [exceptions:protected] => )


Modification of the comprofilerCreateMail using joomla mailer and working fine:
function & comprofilerCreateMail( $from = '', $fromname = '', $subject, $body ) {
global $_CB_framework;
#PublicMail
# Create mail
$mail =& JFactory::getMailer();
# Find info from Joomla configuration
$mainframe = JFactory::getApplication();
$frommail = $mainframe->getCfg('mailfrom');
$fromname = $mainframe->getCfg('fromname');

$mail->setSender( array($frommail, $fromname) );
$mail->addReplyTo( array($senderEmail, $senderName ) );

$mail->addRecipient( $recipientEmail );
$mail->addAttachment( $attachment );
$mail->IsHTML(true);
$mail->setSubject( $subject );
$mail->setBody( $body );
#end PublicMail
return $mail;
#all other lines commented
}
Last edit: 10 years 7 months ago by bruno_c.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 7 months ago #242459 by krileon
Replied by krileon on topic SMTP mails don't works with CB
The SMTP Port and Host both appear to be set. I'm unsure why it's erroring, but again I can't confirm using GMail SMTP so I'm not sure what more to advise. You also likely need the modification you made for cmandril to function with emails sent from CB, which could be contributing to the problems.

Once we've improved our CBLib further for CB 2.x releases we should have better CMS API routing to help avoid issues like this by being able to properly use the CMS API for various tasks like emails, which would allow extensions extending or acting on the CMS API to still function.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: bruno_c

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum