Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Project Web Email

Project Web Email Configuration

In order to send email from the new project web, you need to do the following configuration steps:

  • Configure your project's email password.
  • Use the Project Admin / Feature Settings menu choice and choose "Manage" from the "Project Web" line.
  • Set the password you want to use in the provided text entry and press the "Set Passwords" button.
  • Configure your project web scripts to access our email server via either TLS or SSL SMTP using the following settings:

    host: prwebmail (or ssl://prwebmail)
    port: 25 (or 465 for ssl)
    user: YOUR_PROJECT_NAME
    password: THE_PASSWORD_YOU_CONFIGURED_FOR_YOUR_PROJECT

Be sure to set the permissions on file that contains your password to not be world readable:
chmod o-r whatever.php

General Hints

If you see an error about the smtp server not supporting authorization, you are accessing port 25 without TLS. Unencrypted connections are not supported.
If you see an error about email relay not being supported, you didn't specify the right user (project) & password credentials.

Example Code

Here are a couple examples of how to configure email for project web. These examples use TLS via the normal port 25, but various software might be more easily configured to use ssl access via port 465.

Example for php

<?php

include('Mail.php');

$recipients = array( 'someone@example.com' ); # Can be one or more emails

$headers = array (
    'From' => 'someone@example.com',
    'To' => join(', ', $recipients),
    'Subject' => 'Testing email from project web',
);

$body = "This was sent via php from project web!\n";

$mail_object =& Mail::factory('smtp',
    array(
        'host' => 'prwebmail',
        'auth' => true,
        'username' => 'YOUR_PROJECT_NAME',
        'password' => 'PASSWORD', # As set on your project's config page
        #'debug' => true, # uncomment to enable debugging
    ));

$mail_object->send($recipients, $headers, $body);

Example for perl

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl

use strict;
use warnings;
use Net::SMTP::TLS;

my $mailer = new Net::SMTP::TLS(
    'prwebmail',
    Hello => 'localhost',
    Port => 25,
    User => 'YOUR_PROJECT_NAME',
    Password => 'PASSWORD', # As set on your project's config page
);

my $subject = 'Testing email from project web';
my $body = "This was sent via perl from project web!\n";

$mailer->mail('somebody@example.com'); # From
$mailer->to('Somebody <somebody@example.com');
$mailer->data;
$mailer->datasend("Subject: $subject\n\n$body");
$mailer->dataend;
$mailer->quit;

Related

Documentation: Project Web Services