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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Windows, SendMail, PHP and Problems...


Go to End


2 Posts   2819 Views

Avatar
Landmine

Community Member, 11 Posts

28 May 2009 at 10:26pm

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

Community Member, 11 Posts

28 May 2009 at 11:29pm

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]