Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Windows, SendMail, PHP and Problems...


Reply

2 Posts   1772 Views

Avatar
Landmine

28 May 2009 at 10:26pm Community Member, 11 Posts

So I'm running SS on a Server 2008 box with PHP Version 5.2.6 (http://www.esfiles.com/info.php) and I wanted to have SS be able to email, and since I don't host any mail on this server thanks to Google Apps I'm having a lot of trouble working with the PHP and SendMail to get it to send out emails.

I followed this guide, but no such luck.
http://digiex.net/guides-tutorials/544-configuring-php-under-windows-use-gmail-external-smtp-server-ssl.html

Here are some of my config files

php.ini
-----------------

sendmail_path = "C:\inetpub\sendmail\sendmail.exe -t -i"

-----------------

sendmail.ini
-----------------

smtp_server=smtp.gmail.com

; smtp port (normally 25)

smtp_port=587

; SMTPS (SSL) support
; auto = use SSL for port 465, otherwise try to use TLS
; ssl = alway use SSL
; tls = always use TLS
; none = never try to use SSL

smtp_ssl=ssl

default_domain=domain.com
error_logfile=error.log
debug_logfile=debug.log

auth_username=<GOOGLE APPS EMAIL ACCOUNT>
auth_password=<PASSWORD>

force_sender=<GOOGLE APPS EMAIL ACCOUNT>

-----------------

http://www.esfiles.com/mail.php
-----------------
<?php
$to = "user@domain.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "user2@domain2.com";
$headers = "From: $from";

if (mail($to,$subject,$message,$headers)) {
echo "success!";
} else {
echo "fail…";
}
?>
-----------------

I'm really just lost here. So any help would be amazing. Thanks again all.

Avatar
Landmine

28 May 2009 at 11:29pm Community Member, 11 Posts

For now I'm using MailEnable on my server to work as the SMTP from GoDaddy, however now it wont send emails because the email has [ ] in it.

So can I change the email templates so they dont include those [ ] in the plain text version

Example:
Here is your password reset link[http://www.esfiles.com/Security/changepassword?h=0101010101010101010101]