tips:mailconfig
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tips:mailconfig [2010-08-19 00:19] – 93.205.254.96 | tips:mailconfig [2024-02-02 17:15] (current) – old revision restored (2018-01-25 15:14) Aleksandr | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
+ | 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> | <code ini> | ||
- | # | + | ; For Win32 only. |
- | use Getopt::Std; | + | SMTP = <mail.domain.tld> |
- | use Term:: | + | smtp_port = 25 |
- | use Net:: | + | sendmail_from |
- | getopt(' | + | </ |
- | #$usage= << | + | |
- | # | + | |
- | #Usage: twitter_cmd -u username [-t tweet] [-p password] | + | |
- | #USAGE | + | |
- | sub gp{ | + | |
- | print " | + | |
- | ReadMode 2; | + | |
- | chomp($l | + | |
- | | + | |
- | print " | + | |
- | return $l; | + | |
- | } | + | |
- | if(!$opts{u}){print $usage;exit 1;} | + | |
- | else{$u=$opts{u}; | + | |
- | if(!$opts{t}){print " | + | Restart the web server. |
- | else{$t=$opts{t}; | + | |
- | if(!$opts{p}){$p=& | + | |
- | | + | |
- | $s=Net:: | + | |
- | $s->update({status=> | + | ==== Method #2: Use the "Fake Sendmail" |
- | exit 0; | + | |
+ | Install Sendmail for Windows, from http:// | ||
+ | |||
+ | <code ini> | ||
+ | ; For Unix only. You may supply arguments as well (default: \"sendmail -t -i\"). | ||
+ | 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:// | ||
+ | |||
+ | 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. | ||
+ | |||
+ | > 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.1282169975.txt.gz · Last modified: 2010-08-19 00:19 by 93.205.254.96