473,734 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mail() on linux to use other smtp server

hi all

i have written a php site that uses the mail() on windows and i had to
state in the php.ini file which smtp server to use.

have now migrated this site to a redhat 9 server, but i still want the
emails to be sent via the smtp server i stated earlier.

this may infact be a sendmail question, im not sure, (perhaps changing
sendmail_path in php.ini) but has anyone managed to send email via
mail() in php, on a linux box, that uses an external smtp server?

cheers
evan
Jul 17 '05 #1
1 9885
Hello,

on 02/09/2005 11:03 PM ehendrikd said the following:
hi all

i have written a php site that uses the mail() on windows and i had to
state in the php.ini file which smtp server to use.

have now migrated this site to a redhat 9 server, but i still want the
emails to be sent via the smtp server i stated earlier.
Why? You do not need necessarily to relay the messages in a SMTP server.
Sendmail can send the message for you directly to the recipient SMTP server.

this may infact be a sendmail question, im not sure, (perhaps changing
sendmail_path in php.ini) but has anyone managed to send email via
mail() in php, on a linux box, that uses an external smtp server?


No, I suppose you can configure sendmail to relay its messages to an
intermediate SMTP server if you really have to but that is not something
that you can configure from the sendmail command line arguments in php.ini .

If you really have to relay the messages to a SMTP server, you may want
to try this class that comes with a wrapper function named smtp_mail()
that works exactly like the mail function but lets you configure a SMTP
server to relay your messages.

http://www.phpclasses.org/mimemessage

You also need this:

http://www.phpclasses.org/smtpclass

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #2

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

Similar topics

7
12963
by: Adams-Blake Co. | last post by:
This may be OT a bit, so maybe someone can point me in the right direction. I want to test a script that sends out an e-mail. I want to test it locally on my Mandrake Linux 8.2 box. It runs OK on my host (pair.com) but I have to upload it each time I want to test it. Is there something I need to do in order to test locally? Do I have to set up an SMTP server? Is that hard? Anything else needs to be done? CAN any of this
3
6515
by: martin | last post by:
Just the simplest invocation with hard coded parameters, followed by echoing a message, hangs for exactly 1 minute. ("defaulttimeout" in php.ini is set to 30 (seconds)). If I don't wait, and immediately hit the browser's "stop" button I get that "transfer interrupted" message, but the email still gets sent and received just fine. Sendmail is not running, "sendmail_path" is not set in php.ini, and the email headers look as if the email was...
11
12088
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to use PHP to get inside an OWA (Microsoft Outlook Web Access) website to send email that way? The reason I ask is because my corporate office is going to do away with our rogue SMTP server access and force everything through Exchange
2
7950
by: Mark Carter | last post by:
I'm trying to create a mail server in Twisted. I either get SMTPSenderRefused or SMTPException: SMTP AUTH extension not supported by server. What do I need to do to get it to work?
4
2594
by: manatlan | last post by:
In an intranet/lan, i'd like to put a "python server script" (which run forever) on a computer A... On another computer B, I'd like to send smtp-email to the computer A ... (send to "user@126.52.12.12", for example ...126.52.12.12 is the ip address of "B") in fact, i'd like to control "computer A" by sending smtp email from "computer B".
26
1783
by: Massimo Zaccarin | last post by:
ok, I know that I have to use the System.Web.Mail.SmtpMail class, but I've read from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebmailsmtpmailclasstopic.asp: Requirements Namespace: System.Web.Mail Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family Assembly: System.Web (in System.Web.dll)
8
2846
by: Michel Posseth [MCP] | last post by:
Hi does someone has experience with this ?? i have made a lot of apps in the past that were capable of sending e-mails the server i then talked to was a Linux SMTP server and it worked great Now i work in a company with a MS exchange server and would like to send some e-mails however i can`t get it to work at all error is : ( translated form the dutch language )
17
3790
by: William Gill | last post by:
My development machine (WinXP, Apache 2.2.4) does not have an smtp server, and I don't really want to install one if I can help it. Does anyone know of a simple method of testing php scripts that employ mail() by simulating an smtp server and directing output to a text file or to an installed text editor. Right now I can modify the script to use something instead of mail(), then change it when I put into production, but I would really...
7
2634
by: r0g | last post by:
I'd like PHP to send mail to a local mailserver running at localhost:25 like I used to on windows. This mailserver is a dummy server which just writes the mail to disk for unit testing and works fine when I use thunderbird to send mail to it and used to work fine under windows however... It doesn't work under Ubuntu. Looking at my php.ini file I see...
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9310
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...
0
9182
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
6031
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();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
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.