not getting email sending from website

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shiyou
Forum Newbie
Posts: 3
Joined: Thu Jul 19, 2007 9:58 pm

not getting email sending from website

Post by shiyou »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I have some problem in sending emails from the website back to my email address. 

I am not sure is there anything to do with the incoming server port. Because usually it is set to 110, but my this email is set to 9000. 

I tried using normal php mail function and PHPMailer.

Code: Select all

$to='me@mycompanyemail.com';
$subject='Testing email';
$message='Just a testing email';
// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
		
// Additional headers
$headers .= 'From:  <'.$email.'>' . "\r\n";
		
if ($strmail=mail($to, $subject, $message, $headers))
{
   echo "sucessful";
}
else
{
   echo "Error email";
}
The outcome of this is sucessful, but I didn't receive any email from my inbox nor my junk mail.

Where have my mail been? is there any way that I can do?? Please help!!!


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

The PHP Manual wrote: Note: If messages are not received, try using a LF (\n) only. Some poor quality Unix mail transfer agents replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with » RFC 2822.
You'll also want to ensure the return path is being set.
Phoenixheart
Forum Contributor
Posts: 123
Joined: Tue Nov 16, 2004 7:46 am
Contact:

Post by Phoenixheart »

Also, did you set the email address to send from? Try ini_set('sendmail_from', 'your@email.here')?
shiyou
Forum Newbie
Posts: 3
Joined: Thu Jul 19, 2007 9:58 pm

Post by shiyou »

astions wrote:
The PHP Manual wrote: Note: If messages are not received, try using a LF (\n) only. Some poor quality Unix mail transfer agents replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with » RFC 2822.
You'll also want to ensure the return path is being set.
What do u mean "ensure the return path is being set"? Any example to this statement?
shiyou
Forum Newbie
Posts: 3
Joined: Thu Jul 19, 2007 9:58 pm

Post by shiyou »

PHOENIXHEART wrote:Also, did you set the email address to send from? Try ini_set('sendmail_from', 'your@email.here')?
Where do i need to set this??
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

shiyou wrote:
PHOENIXHEART wrote:Also, did you set the email address to send from? Try ini_set('sendmail_from', 'your@email.here')?
Where do i need to set this??
Anywhere before you try to send a message.

This could all be avoided with an SMTP connection using Swiftmailer.
Post Reply