tips:mailconfig
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
tips:mailconfig [2008-10-10 06:08] – 24.82.33.71 | tips:mailconfig [2024-02-02 16:00] – [(older comments)] 2a01:cb00:21:a00:5d08:da6e:3a0e:6b14 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Sending mails with SMTP ====== | ||
+ | There is a [[plugin: | ||
+ | |||
+ | Everything below is no longer needed and shouldn' | ||
+ | |||
+ | ====== Sendmail for Windows ====== | ||
+ | |||
+ | If you are looking for a way to make DokuWiki talk to any SMTP server, including one which might not be on the same machine, then you should probably look at this [[http:// | ||
+ | |||
+ | :?: If you are using Windows, wouldn' | ||
+ | |||
+ | :-? no way. after the patch in [[http:// | ||
+ | |||
+ | ===== Windows-specific instructions ===== | ||
+ | |||
+ | Due to all the layers involved, there are several ways to configure email. | ||
+ | |||
+ | ==== Method #1: Using PHP to Send the Email Directly ==== | ||
+ | Edit PHP.INI and set these variables (replace < | ||
+ | |||
+ | <code ini> | ||
+ | ; For Win32 only. | ||
+ | SMTP = < | ||
+ | smtp_port = 25 | ||
+ | sendmail_from = < | ||
+ | </ | ||
+ | |||
+ | Restart the web server. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== Method #2: Use the "Fake Sendmail" | ||
+ | |||
+ | Install Sendmail for Windows, from http:// | ||
+ | |||
+ | <code ini> | ||
+ | ; For Unix only. You may supply arguments as well (default: \" | ||
+ | sendmail_path = C: | ||
+ | </ | ||
+ | |||
+ | Note that if the path to sendmail.exe contains spaces then you may need to use 8.3 notation. | ||
+ | |||
+ | Next, edit sendmail.ini: | ||
+ | |||
+ | <code ini> | ||
+ | ; you must change mail.mydomain.com to your smtp server | ||
+ | smtp_server=< | ||
+ | ; if your smtp server requires authentication, | ||
+ | ; following two lines | ||
+ | ; | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | Restart the web server. | ||
+ | ---- | ||
+ | === 1 Successful example of using sendmail in windows to configure REMOTE EXCHANGE server in PHP Dokuwiki === | ||
+ | |||
+ | //Im Ruby from WelcomeNetworks.com Canada. Today I have used sendmail in windows apache successfully. I had a remote exchange SMTP server which I had to configure to speak with Dokuwiki for my client, and I did it Successfully. This is how I did it:// | ||
+ | |||
+ | *First I stored the sendmail in C: | ||
+ | |||
+ | * these settings in sendmail.ini in the sendmail folder smtp_server=your remote server' | ||
+ | |||
+ | * php.ini file the path I gave for sendmail was like this-- sendmail_path =" | ||
+ | |||
+ | Please note that people say that -t switch is for unix only, but I used this in windows today as of on 9th Oct 2008, and It WORKED. When I tried all other ways, nothing worked, this at last worked, Thank GOD\\ | ||
+ | **If you have any questions feel free to email me at ruby_brars@yahoo.com** | ||
+ | ---- | ||
+ | |||
+ | ==== Method #3: Use the " | ||
+ | |||
+ | There is another way of sending out e-mails using somebody' | ||
+ | |||
+ | * Download " | ||
+ | |||
+ | * Create configuration file named " | ||
+ | |||
+ | <code ini> | ||
+ | host smtp.gmail.com | ||
+ | auth on | ||
+ | user noreply@domainname.com | ||
+ | password blahblah | ||
+ | tls on | ||
+ | tls_starttls on | ||
+ | from noreply@domainname.com | ||
+ | maildomain domainname.com | ||
+ | account default : gmail | ||
+ | logfile msmtp.log | ||
+ | tls_certcheck off</ | ||
+ | |||
+ | * Modify PHP.INI same way as described above. Comment out properties " | ||
+ | < | ||
+ | Please note that path should NOT be enclosed into quotes, otherwise you will get " | ||
+ | |||
+ | * Restart the web server. | ||
+ | |||
+ | ==== One Example of Configuring Windows XP with PHP 5 using Method #2 ==== | ||
+ | My company' | ||
+ | |||
+ | I initially configured PHP.ini to use " | ||
+ | |||
+ | So in PHP.ini (for XAMPP installations use C:\Program Files\xampp\apache\bin\php.ini), | ||
+ | |||
+ | <code ini> | ||
+ | ; For Win32 only. | ||
+ | SMTP = exchange | ||
+ | smtp_port = 25 | ||
+ | </ | ||
+ | |||
+ | I commented those lines out and directed PHP to use the sendmail.exe program that ships with XAMPP (it's also available elsewhere; search for "fake sendmail" | ||
+ | |||
+ | <code ini> | ||
+ | ; For Unix only. | ||
+ | sendmail_path = " | ||
+ | </ | ||
+ | |||
+ | Note that specifying " | ||
+ | |||
+ | Then, in the fake sendmail' | ||
+ | |||
+ | <code ini> | ||
+ | smtp_server=exchange | ||
+ | </ | ||
+ | |||
+ | After restarting Apache, emails then sent correctly from within Dokuwiki. | ||
+ | |||
+ | |||
+ | ==== Comments ==== | ||
+ | |||
+ | |||
+ | ====== Sendmail for Linux ====== | ||
+ | |||
+ | ===== PHP and safe mode ===== | ||
+ | |||
+ | If you are using the PHP safe mode, you will need to remove the fifth parameter from the '' | ||
+ | |||
+ | Could you specify which part and from where? Thanks! (php-beginner) | ||
+ | |||
+ | Change | ||
+ | < | ||
+ | return @mail($to, | ||
+ | </ | ||
+ | to | ||
+ | < | ||
+ | return @mail($to, | ||
+ | </ | ||
+ | ===== Unix (Linux) sendmail setup ===== | ||
+ | |||
+ | If you're running DokuWiki on a machine without a functioning sendmail, | ||
+ | and you use another machine | ||
+ | for sendmail services, here's a couple of | ||
+ | simple ways to get it going. | ||
+ | |||
+ | **(1)** Edit / | ||
+ | |||
+ | < | ||
+ | ; For Unix only. You may supply arguments as well (default: " | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | to look like this | ||
+ | |||
+ | < | ||
+ | ; For Unix only. You may supply arguments as well (default: " | ||
+ | sendmail_path = / | ||
+ | </ | ||
+ | |||
+ | Replace ''' | ||
+ | |||
+ | **(2)** If for some reason you can't do (1), another solution is to create a script that | ||
+ | pretends to be '' | ||
+ | |||
+ | < | ||
+ | #!/bin/sh | ||
+ | |||
+ | / | ||
+ | </ | ||
+ | |||
+ | Put these lines in a file called sendmail somewhere where PHP will find it and make the file executable ('' | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====== DokuWiki with an External Mail Server ====== | ||
+ | When running a DokuWiki on Windows or other platforms you might find that you wish to use an SMTP server that does not reside on the same machine. | ||
+ | |||
+ | :!: This [[http:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
+ | Note: Windows installations can use the "fake sendmail" | ||
+ | |||
+ | ===== (older comments) ===== | ||
+ | |||
+ | Is there any news on making sendmail work on a server that one doesn' | ||
+ | |||
+ | I would also like any news on running through a different SMTP server on the network. | ||
+ | |||
+ | I would also like any news on running through a different SMTP server on the network. | ||
+ | [[https:// | ||
+ | ]]> I've not been successful in running Sendmail for Windows, yet. Has anyone managed to run Sendmail for Windows successfully? | ||
+ | |||
+ | >> Try using sendmail_path = \" | ||
+ | |||
+ | >>> | ||
+ | |||
+ | - add \" | ||
+ | - set the mail server in local.php \" | ||
+ | - in mail.php, delete the line \" | ||
+ | |||
+ | >>>> | ||
+ | |||
+ | >>>>> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | > After modify php.ini, remember to **restart Apache server**, or you will still get an error. -- Fwolf (2005.09.07) | ||
+ | |||
+ | > Try to use the first method which simply modifies PHP.ini. I failed with the second one which requires sendmail.exe but succeeded with the first one. :-D -- Minyang (2006.12.05) | ||
+ | >> This may have been due to the 8.3 path issue mentioned in the [[#One Example of Configuring Windows XP with PHP 5 using Method #2|Windows example]]. |
tips/mailconfig.txt · Last modified: 2024-02-02 17:15 by Aleksandr