HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


email can not be received

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#110206 (In Topic #21936)
Avatar

Fan in action

my ocportal web can not send email

Dear admin,

I need your help….

 I have installed ocportal with LAMP in google cloud hosting. Everything is oke but untill now, my web can not send out email although the notification in the web said email has been sent etc.

I tried modify configuration server with sendmail, postfi, smtp, msmtp, etc. But, everything is terrible.  

Please help me.. 
Thank you… :)
Back to the top
 
Posted
Rating:
#110208
Avatar

It's hard to provide advice for this situation, as it sounds like your server's email just isn't configured properly.

However, a first step in solving any problem is to simplify it to isolate it.

So I'd try writing a tiny PHP script that just uses PHP's mail command to send an email directly, and see if that works.

I would also try the 'sendmail' command on the command line to send a mail direct to sendmail (or whatever mail agent you have, as I believe they all simulate the same interface).

Otherwise…

You can check logs, check mail blacklists on the IP, etc.

So really it is work for an experienced sysadmin to debug through, or following a set of instructions for Google Cloud, but I don't have a definitive answer.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#110212
Avatar

Fan in action

Yeah, i am so confuse..
I've tried modify info.php to bypass email config and tried use maildrill for mstp but still not work..

If you have others idea.. please inform me..
Thanks so much…
Back to the top
 
Posted
Item has a rating of 5 (Liked by Guest)  
Rating:
#110214
Avatar

Community saint

Double check the email guidelines for Google Cloud Platform here: Mail PHP API Overview - PHP --- Google Cloud Platform

Be sure the outgoing send-from address you are using for ocPortal is properly configured as specified in the 'Sending mail' section of the link posted above. If your ocPortal send-from address isn't configured in your Google Cloud hosting app, the emails will be discarded. The ocPortal send-from address is specified in the ocPortal setup at Adminzone>Setup>Configuration>Site Options, the 'Website e-mail address' setting in the 'e-mail' section if using PHP mail or the 'E-mail address' setting in the 'SMTP' section if using an external SMTP server.

I believe an external SMTP server won't work with Google Cloud Platform unless you can configure it to use non-standard port numbers since Google Cloud Platform blocks the standard SMTP ports.
Back to the top
 
Posted
Rating:
#110218
Avatar

Fan in action

Thanks Jason, 
It's good information..

I've already set up my SFP, but i don't know which is php file must be modified with this code :


use \google\appengine\api\mail\Message;




// Notice that $image_content_id is the optional Content-ID header value of the
//  attachment. Must be enclosed by angle brackets (<>)
$image_content_id = '<image-content-id>';




// Notice that $image_data is the raw file data of the attachment.
try
{
  $message = new Message();
  $message->setSender("from@google.com");
  $message->addTo("to@google.com");
  $message->setSubject("Example email");
  $message->setTextBody("Hello, world!");
  $message->addAttachment('image.jpg', $image_data, $image_content_id);
  $message->send();
} catch (InvalidArgumentException $e) {
  // …
}



Can you help me?
Back to the top
 
Posted
Rating:
#110220
Avatar

Community saint

You shouldn't need to modify any .php files with that code to get the emails working in ocPortal. That code is just an example of how to send email directly through the Google App Engine mail API without using the PHP mail() function.

If you have all of the email config settings set correctly in ocPortal and the emails still don't get sent, then you probably don't have the LAMP configuration correct, or something with your account configuration is not correct, or there is some sort of restriction on your account that is preventing you from sending email.

Have you done as Chris suggested and created a small test PHP script to send an email with the PHP mail() function? If you do this and the test script can send email, then the problem is probably with your email settings in the ocPortal configuration. But if the test script can't send email, then the problem is probably with your Google Cloud account or with the LAMP stack configuration. If the problem is with your account or LAMP stack configuration, the best place to get help with that will be in one of the Google Community forums. Here is a page that has links to 3rd party sites and Google Community discussion forums where you can get help regarding those account or server configuration issues: Join a Google Cloud Platform community - Developers Console Help
Back to the top
 
Posted
Item has a rating of 5 (Liked by Jason Verhagen)  
Rating:
#110223
Avatar

Fan in action

Thanks jason cris,

It works….. :)

SOLVED
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: