Jump to content

Recommended Posts

I've been tearing my hair out for 3 days now over something that some 12 year old could probably do in 10 minutes in his sleep.

 

My Joomla site sends mail  just fine, but I can't even get the simplest php script to send mail.  By simplest I mean

 

<?php
$txt = "Some text";

mail ("[email protected]","Test subject",$txt);
?> 

 

I'm using Ubuntu server, sendmail is all configured. Joomla sends just fine, I'm trying to send from a simple form on a webpage outside of Joomla which brings me to believe that there's something I'm not including in the script that it needs to work. 

 

Can you break down each thing that I should check on the server and each thing I should include in the script to just make it work?

 

Please help.

Link to comment
https://forums.phpfreaks.com/topic/204962-mail-scripts-wont-work/
Share on other sites

Try setting header, look into smtp, go see how joomla does it or use a framework like codeigniter.

 

Which is what I've been doing, and has led me on a wild goose chase.  I was looking more for something like "these are the abc's to get the mail to send based on your configuration", I'm a little sick of all this reverse engineering for something so blatantly simple.

A) At a minimum you need to provide a From: email address (there's no guarantee that a valid default from address is setup in the php.ini.)

 

B) Have you examined your Joomla mail settings to see if there are any special requirements, such as SMTP authentication.

 

C) Have you examined your web host FAQ section to see when method to use or if there are any special requirements to use the mail server?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.