14 Replies - 2056 Views - Last Post: 26 April 2011 - 07:44 PM Rate Topic: -----

#1 openinfinity   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 215
  • Joined: 25-March 09

php mail issue maybe a server issue tho

Posted 25 April 2011 - 12:07 AM

ok so I recently set up a posfix mysql mail combo server on a lamp box


I can send to internal and external fine with my client
I can sen to my internal with php script

my server puts from <[email protected]> //which is not where my mail pointers point
it's in the /var/log/mail.log

when I send it to myself the virtual domains I'm hosting on this box I get it no problem and the header information looks right

I assume it's getting rejected from gmail and yahoo because of this

recipient invalid domain (in reply to RCPT TO command))


anybody got any ideas?

Is This A Good Question/Topic? 0
  • +

Replies To: php mail issue maybe a server issue tho

#2 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6877
  • View blog
  • Posts: 31,672
  • Joined: 10-May 07

Re: php mail issue maybe a server issue tho

Posted 25 April 2011 - 12:10 AM

You should be able to change your sending domain in php.ini, however your ip reversal should point to the domain name or else it may still be rejected as spam.
Was This Post Helpful? 0
  • +
  • -

#3 openinfinity   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 215
  • Joined: 25-March 09

Re: php mail issue maybe a server issue tho

Posted 25 April 2011 - 12:14 AM

when I send from thunderbird the mail.log show's sent from correct virtual server
but when I send from php it puts from=<[email protected]>
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6877
  • View blog
  • Posts: 31,672
  • Joined: 10-May 07

Re: php mail issue maybe a server issue tho

Posted 25 April 2011 - 12:16 AM

Taken from here

Quote

PHP Email Setup

Before we can send email with PHP, we need to set it up to do so, just as you need to set up your email program before it can send messages. Configuration for sending email in PHP is done with the php.ini file, so open up your Web serverís php.ini in whichever editor you normally use.

If you donít run your own server, but instead have a PHP-equipped Web host, you can safely assume that everything in this section has been done for you, and skip ahead.

In the section entitled [mail function] in the php.ini file, youíll find three settings: SMTP, sendmail_from, and sendmail_path. If your server runs on a Windows machine, youíll want to set the SMTP option to point to your SMTP server (or your ISPís SMTP server, if youíre setting up PHP on your home machine). If instead youíre setting up PHP on a Linux (or other Unix-based OS) server, youíll want to set the sendmail_path option to point to the sendmail program on your server, passing it the -t option. You can use the SMTP option in Linux instead if you donít have sendmail set up.

In either case, youíll want to set the sendmail_from option to your email address, or whichever address youíd like to appear as the default Ďfromí address for emails sent from PHP scripts.

Hereís how the section might look on a typical Windows server, or on a Linux server without sendmail:
[mail function] ; Setup for Windows systems SMTP = smtp.my.isp.net sendmail_from = [email protected]

And hereís how it might look on a Linux server with sendmail:
[mail function] ; Setup for Linux systems sendmail_path = /usr/sbin/sendmail -t sendmail_from = [email protected]

With those settings in place, restart your Web server and youíre ready to go!


Check your php.ini file...
Was This Post Helpful? 0
  • +
  • -

#5 openinfinity   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 215
  • Joined: 25-March 09

Re: php mail issue maybe a server issue tho

Posted 25 April 2011 - 12:30 AM

Thank you


Is there a way to specify multiple domains if I have multiple virtual domains on one box?

How do ISP's configure it for use with multiple domains

This post has been edited by openinfinity: 25 April 2011 - 12:36 AM

Was This Post Helpful? 0
  • +
  • -

#6 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6877
  • View blog
  • Posts: 31,672
  • Joined: 10-May 07

Re: php mail issue maybe a server issue tho

Posted 25 April 2011 - 12:48 AM

An ISP wouldn't use PHP, they would use a Mail Transfer Agent, such as sendmail or qmail.

With a Mail Transfer Agent you can use PHP to connect directly using SMTP. If you only use the mail() function provided by PHP, then it's going to refer to php.ini for the return address.
Was This Post Helpful? 0
  • +
  • -

#7 openinfinity   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 215
  • Joined: 25-March 09

Re: php mail issue maybe a server issue tho

Posted 25 April 2011 - 12:59 AM

View Postno2pencil, on 25 April 2011 - 01:48 AM, said:

An ISP wouldn't use PHP, they would use a Mail Transfer Agent, such as sendmail or qmail.

With a Mail Transfer Agent you can use PHP to connect directly using SMTP. If you only use the mail() function provided by PHP, then it's going to refer to php.ini for the return address.




I meant how would they host the php so multiple users could send using php if they wanted two use it with multiple domains
like if I bought space on a hosting spot and gave gave me an enviroment to host my domain and run php scripts


I added my isp smtp information but my mail.log still shows same results after rebooting and trying again

View Postno2pencil, on 25 April 2011 - 01:48 AM, said:

An ISP wouldn't use PHP, they would use a Mail Transfer Agent, such as sendmail or qmail.

With a Mail Transfer Agent you can use PHP to connect directly using SMTP. If you only use the mail() function provided by PHP, then it's going to refer to php.ini for the return address.


that's what I want is to I have a MTA I'm using postfix and courier with mysql to store the virtual domains

how can I use php to specify which virtual domain to send from?
Was This Post Helpful? 0
  • +
  • -

#8 openinfinity   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 215
  • Joined: 25-March 09

Re: php mail issue maybe a server issue tho

Posted 25 April 2011 - 01:06 AM

is this the right INI /etc/php5/apache2/php.ini
Was This Post Helpful? 0
  • +
  • -

#9 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6877
  • View blog
  • Posts: 31,672
  • Joined: 10-May 07

Re: php mail issue maybe a server issue tho

Posted 25 April 2011 - 01:13 AM

View Postopeninfinity, on 25 April 2011 - 03:59 AM, said:

how can I use php to specify which virtual domain to send from?

I provided a link to a tutorial.

no2pencil said:

With a Mail Transfer Agent you can use PHP to connect directly using SMTP. If you only use the mail() function provided by PHP, then it's going to refer to php.ini for the return address.

Was This Post Helpful? 1
  • +
  • -

#10 openinfinity   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 215
  • Joined: 25-March 09

Re: php mail issue maybe a server issue tho

Posted 25 April 2011 - 01:16 AM

SMTP string

Used under Windows only: host name or IP address of the SMTP server PHP should use for mail sent with the mail() function.

this says this option is only for windows

do I need to install sendmail

will it conflict with my current mail setup?

View Postno2pencil, on 25 April 2011 - 02:13 AM, said:

View Postopeninfinity, on 25 April 2011 - 03:59 AM, said:

how can I use php to specify which virtual domain to send from?

I provided a link to a tutorial.

no2pencil said:

With a Mail Transfer Agent you can use PHP to connect directly using SMTP. If you only use the mail() function provided by PHP, then it's going to refer to php.ini for the return address.


Ok cool I think that will work
Was This Post Helpful? 0
  • +
  • -

#11 openinfinity   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 215
  • Joined: 25-March 09

Re: php mail issue maybe a server issue tho

Posted 25 April 2011 - 11:01 AM

I got the script to work under port 25 but under 465 I get an error I added the value 1 for $secure



trying to test the script I get this

SSL_accept error from mail.mydomain.com[my ipaddres]: -1
Apr 25 11:47:49 myhostname postfix/smtpd[1785]: warning: TLS library problem: 1785:error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol:s23_srvr.c:578:



I guess I need to find out the method postfix accepts?

when I use 25 all my header fields are correct I just notice one value that is blank in the log
message-id=<>

This post has been edited by openinfinity: 25 April 2011 - 11:07 AM

Was This Post Helpful? 0
  • +
  • -

#12 openinfinity   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 215
  • Joined: 25-March 09

Re: php mail issue maybe a server issue tho

Posted 25 April 2011 - 01:37 PM

so I can send under 25 to external but I feel unsecure
Was This Post Helpful? 0
  • +
  • -

#13 openinfinity   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 215
  • Joined: 25-March 09

Re: php mail issue maybe a server issue tho

Posted 25 April 2011 - 03:04 PM

I got it incorporated into my registration script but am now trying to figure out how I hide the telenet stuff from the screen

connection accepted
220 localhost ESMTP Postfix

Continuing

This post has been edited by openinfinity: 25 April 2011 - 04:09 PM

Was This Post Helpful? 0
  • +
  • -

#14 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6877
  • View blog
  • Posts: 31,672
  • Joined: 10-May 07

Re: php mail issue maybe a server issue tho

Posted 25 April 2011 - 03:28 PM

Just remove the echo statements in the PHP code. I only added them for troubleshooting.
Was This Post Helpful? 0
  • +
  • -

#15 openinfinity   User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 215
  • Joined: 25-March 09

Re: php mail issue maybe a server issue tho

Posted 26 April 2011 - 07:44 PM

Cool thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1