473,804 Members | 3,250 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP Email


Hello all,

How can i send email using PHP from my server ?
Which settings are necessary ?

please, guide me
Thanks in advance.

Apr 27 '07
17 1955
Max
Our mail server accepts emails from the webserver. Our emails are
going through default MX records, which point to our ISP server, which
does relay emails to our mail server. Simply put, I want to bypass the
MX record (which points to the ISP server's SPAM filter, which works
for us for all other mail, we have no control over)

Apr 30 '07 #11
Max
On Apr 27, 9:30 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
Max wrote:
I have a question related to this post:
We are using 2 different Linux based servers: one for web (PHP, MySQL)
and another for the mail (Qmail, SquirrelMail e.t.c.). Our webserver
is co-located and mail server is installed here. For the PHP mail()
function to be able to use the mail server, I modified php.ini for
SMTP to pointi to the mail server' IP. Yet it still uses web server's
sendmail as SMTP MTA.
Please help

Did you define sendmail_path in your php.ini? Also, after changing your
php.ini, did you stop and restart your server?

What do you have for your sendmail parameters in your php.ini?

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===
The sendmail_path in php.ini was commented out. I have uncommened it
and set the value to nothing. I did restart Apache after that.

Apr 30 '07 #12
Max wrote:
Our mail server accepts emails from the webserver. Our emails are
going through default MX records, which point to our ISP server, which
does relay emails to our mail server. Simply put, I want to bypass the
MX record (which points to the ISP server's SPAM filter, which works
for us for all other mail, we have no control over)
In that case you'd have to look at your Unix/Linux configuration. PHP
knows nothing about MX records.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
May 1 '07 #13
Max wrote:
On Apr 27, 9:30 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
>Max wrote:
>>I have a question related to this post:
We are using 2 different Linux based servers: one for web (PHP, MySQL)
and another for the mail (Qmail, SquirrelMail e.t.c.). Our webserver
is co-located and mail server is installed here. For the PHP mail()
function to be able to use the mail server, I modified php.ini for
SMTP to pointi to the mail server' IP. Yet it still uses web server's
sendmail as SMTP MTA.
Please help
Did you define sendmail_path in your php.ini? Also, after changing your
php.ini, did you stop and restart your server?

What do you have for your sendmail parameters in your php.ini?

--
============== ====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attg lobal.net
============== ====

The sendmail_path in php.ini was commented out. I have uncommened it
and set the value to nothing. I did restart Apache after that.
True, I forgot - that's a Windows only parameter. For Linux you need
sendmail or sendmail substitute on your system.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
May 1 '07 #14
Max wrote:
Our mail server accepts emails from the webserver. Our emails are
going through default MX records, which point to our ISP server, which
does relay emails to our mail server. Simply put, I want to bypass the
MX record (which points to the ISP server's SPAM filter, which works
for us for all other mail, we have no control over)
"Jerry Stuckle" <js*******@attg lobal.netwrote:
: In that case you'd have to look at your Unix/Linux configuration. PHP
: knows nothing about MX records.

MX is pure DNS. It points to a mail server which usually opens port
25 up for SMTP and port 110 for POP3. PHP tends to run under an
Apache server which in turn opens port 80, unless one configures
weird/different things with port numbers.

Note, every IP address includes a port number, and a full connect
cannot be established without supplying the 5th element of the IP
address (the port number).

11.11.11.11:80 is a different IP address than 11.11.11.11:25.

When an SMTP server wants to relay mail to your mail server, it
issues an MX (DNS) query. PHP runs underneath Apache, but
I thought I read something somewhere that PHP can make and
accept connections on other ports. Perhaps, I'm getting it mixed
up with some Perl things I've read?

Anyways, that tends to be the way I think of it all. Please correct
me if anything I've stated is wrong.

http://us2.php.net/manual/en/ref.sockets.php
http://us2.php.net/manual/en/function.socket-bind.php
http://us2.php.net/manual/en/function.fsockopen.php

It almost appears that PHP can become a fully functional SMTP
server and/or POP3/IMAP server.

--
Jim Carlock
Post replies to the group.
May 1 '07 #15
Jim Carlock wrote:
Max wrote:
>Our mail server accepts emails from the webserver. Our emails are
going through default MX records, which point to our ISP server, which
does relay emails to our mail server. Simply put, I want to bypass the
MX record (which points to the ISP server's SPAM filter, which works
for us for all other mail, we have no control over)

"Jerry Stuckle" <js*******@attg lobal.netwrote:
: In that case you'd have to look at your Unix/Linux configuration. PHP
: knows nothing about MX records.

MX is pure DNS. It points to a mail server which usually opens port
25 up for SMTP and port 110 for POP3. PHP tends to run under an
Apache server which in turn opens port 80, unless one configures
weird/different things with port numbers.

Note, every IP address includes a port number, and a full connect
cannot be established without supplying the 5th element of the IP
address (the port number).

11.11.11.11:80 is a different IP address than 11.11.11.11:25.

When an SMTP server wants to relay mail to your mail server, it
issues an MX (DNS) query. PHP runs underneath Apache, but
I thought I read something somewhere that PHP can make and
accept connections on other ports. Perhaps, I'm getting it mixed
up with some Perl things I've read?
Sure, PHP can make and accept connections on other ports. It has
nothing to do with running under Apache. But PHP knows nothing about MX
records.

In fact, it knows nothing about A records, either. All it knows it it
can connect to a server by name, TCP/IP performs the DNS lookup
transparently.
Anyways, that tends to be the way I think of it all. Please correct
me if anything I've stated is wrong.

http://us2.php.net/manual/en/ref.sockets.php
http://us2.php.net/manual/en/function.socket-bind.php
http://us2.php.net/manual/en/function.fsockopen.php

It almost appears that PHP can become a fully functional SMTP
server and/or POP3/IMAP server.
It could be. But there's no implementation - and I suspect there never
will be. A SMTP server is quite complex. A POP3/IMAP server is less
so, but still complicated. Both would be quite slow in any interpreted
language.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
May 1 '07 #16
Max
Thank you for your posts. I appreciate your feeback.

I agree that PHP can connect to any port and SMTP port 25 is not an
issue.
What I want to accomplish is - instead of sending emails using
standard route (MX pointer): 111.111.111.111 -121.121.121.121 ->
222.222.222.222

I want to bypass that so that mail sent by PHP mail() function will be
forwarded directly: 111.111.111.111 -222.222.222.222

I will allow relay on 222.222.222.222 for 111.111.111.111 .

I think it is possible to do on Windows machine by adding a record in
lmhosts file.

Can I do it on Linux, by rewriting php.ini or is it Qmail config?

May 1 '07 #17
Max wrote:
Thank you for your posts. I appreciate your feeback.

I agree that PHP can connect to any port and SMTP port 25 is not an
issue.
What I want to accomplish is - instead of sending emails using
standard route (MX pointer): 111.111.111.111 -121.121.121.121 ->
222.222.222.222

I want to bypass that so that mail sent by PHP mail() function will be
forwarded directly: 111.111.111.111 -222.222.222.222

I will allow relay on 222.222.222.222 for 111.111.111.111 .

I think it is possible to do on Windows machine by adding a record in
lmhosts file.

Can I do it on Linux, by rewriting php.ini or is it Qmail config?
No, you can't do it by changing the PHP.INI file. On Linux you have to
connect to a smtp server on that machine. And once PHP dumps the mail
off to the MTA, there is nothing more it can do with it.

You need to follow up in a newsgroup related to your MTA and/or Linux
configuration. There isn't anything you can do with it in MySQL.

But those would all be bypasses. You should get your ISP to modify it's
MTA configuration to allow mail to be sent from your webserver also.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
May 1 '07 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
8803
by: Chuck Anderson | last post by:
Can anyone point me in the right direction? I want to use Php to automate confirmation of someone joining an email list by them replying to an email (so they don't have to have a browser?). I will probably use a hyperlink with a unique ID, but I also want to know how to go about reading from a mailbox with Php so I can use an email reply method, too. I'm having trouble finding any kind of tutorial. From the bit of searching I've done,...
4
3023
by: dmiller23462 | last post by:
So here's my problem.....I need to set up different email distributions based on which option in the following Select form has been chosen....For instance if "Putaway" is chosen it needs to email User1@here.whatever and User4@here.whatever but if "Loaded" is chosen it needs to email User2@here.whatever and User3@here.whatever, etc, etc... I'm aware that the only thing that really needs to change is the "Mail.AddAddress" line (at least...
88
12585
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
2
2226
by: BSG-SMTP-Gateway | last post by:
The following message sent by this account has violated system policy: Connection From: 64.253.55.90 From: python-list@python.org To: terriss@birdsall.com, q4dzsAEAAAAA@birdsall.com, zSbxT7FSCIAEAAAAA@birdsall.com, rQEAAAAA@birdsall.com, 20a.9ea7bfe.306372db@birdsall.com, Gslotnick@birdsall.com, chrisbaker@birdsall.com, mshawver@birdsall.com, SJCSmile@birdsall.com, Pugsleydmd@birdsall.com, FredBMaier@birdsall.com, dbosco6896@birdsall.com,...
26
2829
by: libsfan01 | last post by:
Hi all! Can anyone show me how to check and email field on a form for the existence of these two characters. Kind regards Marc
3
2879
by: g0c | last post by:
hi, how to hide or replace email addresses in php mail function with something like "group" so the email addresses to which email is sent are not visible ? i have : $subs = "email1@dot.com, emai2@dot.com, email3@dot.com" $header .= "To : email@notset.com\r\n";
3
2522
by: Erik Johnson | last post by:
THE GOAL: I need to send an email with a simple ASCII text body and an attached HTML file. I have scripts that send basic emails via the smtplib module that don't have any attachements and that seems to work fine. I first looked at the mimetools modules but it says it is depreceated since 2.3, so I started trying to use the email module. Here is a script that basically follows the second example given in section 7.1.13 of the Python...
15
15244
by: Craig Hurley | last post by:
Hello, user@x.com receives an email from user@a.com. I want to forward that email to user@y.com. I want the contents/header to remain intact, with the exception of adding "X-Forwarded-For". In other words, when user@y.com received the email, it will be from user@a.com, but will contain a reference that it was forwarded by user@x.com. I'm piping all email destined for user@x.com to a php script. I've seen some very complicated...
3
8976
by: IGD | last post by:
I don't know if this is the right place to post this or not. If not, could someone direct me elsewhere where I would find more information on how to solve my problem? Thanks! My problem is this: I am writing an application for work. This application sends a basic html email via SMTP to a group. In this group are individual people's emails, but also about 5 other groups. The problem is that the email is only getting received by (or sent...
27
4946
matheussousuke
by: matheussousuke | last post by:
I'm having trouble with e-mail sending, I mean, the website is suposed to send a confirmation email after sign up, but it gets like text plain instead of HTML May someone help me, please? Here's the code <?php require_once 'path_cnfg.php';
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10589
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10327
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7625
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2999
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.