Script needed

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Script needed

Earnie Boyd

I need someone to write a script, php, bash or both, to read a table
containing an email address, subject and body, format the mail and then
send it out.

Well, it's probably already written, I can use it to send mail to users
from the website while we look for alternatives.

Earnie

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Script needed

John E. / TDM
Earnie Boyd wrote:
> I need someone to write a script, php, bash or both, to read a table
> containing an email address, subject and body, format the mail and then
> send it out.
>
> Well, it's probably already written, I can use it to send mail to users
> from the website while we look for alternatives.
>  

An alternative might be garnered from the instructions here:
<http://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Sourceforge.net#Sending_mail_from_MediaWiki>

But if that doesn't work, something can be readily hacked up with
PHPMailer or similar (as long as you know of an SMTP server that can be
used).

-John E.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Script needed

Tonal
In reply to this post by Earnie Boyd
Earnie Boyd wrote:
> I need someone to write a script, php, bash or both, to read a table
> containing an email address, subject and body, format the mail and then
> send it out.
My be python?

[code=python]
import smtplib

def send_mail(from_addr, to_addr, subj, body):
   msg = '\r\n'.join((
     'From: ' + from_addr,
     'To: ' + to_addr,
     'Subject: ' + subj,
     '', body))
   server = smtplib.SMTP('localhost')
   server.sendmail(fromaddr, toaddrs, msg)
   server.quit()
[/code]
How to about table format?
--
Alexandr N. Zamaraev


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Script needed

Earnie Boyd
In reply to this post by John E. / TDM

Quoting "John E. / TDM" <[hidden email]>:

> Earnie Boyd wrote:
>> I need someone to write a script, php, bash or both, to read a table
>> containing an email address, subject and body, format the mail and then
>> send it out.
>>
>> Well, it's probably already written, I can use it to send mail to users
>> from the website while we look for alternatives.
>>
>
> An alternative might be garnered from the instructions here:
> <http://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Sourceforge.net#Sending_mail_from_MediaWiki>
>
> But if that doesn't work, something can be readily hacked up with
> PHPMailer or similar (as long as you know of an SMTP server that can be
> used).
>

Yea, that's what we were doing.  The issue is there is no more
shell.sourceforge.net.

Earnie

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Script needed

Earnie Boyd
In reply to this post by Tonal

Quoting Tonal <[hidden email]>:

> Earnie Boyd wrote:
>> I need someone to write a script, php, bash or both, to read a table
>> containing an email address, subject and body, format the mail and then
>> send it out.
> My be python?
>
> [code=python]
> import smtplib
>
> def send_mail(from_addr, to_addr, subj, body):
>   msg = '\r\n'.join((
>     'From: ' + from_addr,
>     'To: ' + to_addr,
>     'Subject: ' + subj,
>     '', body))
>   server = smtplib.SMTP('localhost')
>   server.sendmail(fromaddr, toaddrs, msg)
>   server.quit()
> [/code]
> How to about table format?

Thanks, I've got a few ideas I'm looking at.  If I want to consider
your idea more I'll contact you privately.

Earnie

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: Script needed

Ross Ridge
In reply to this post by Earnie Boyd
Earnie Boyd writes:
>I need someone to write a script, php, bash or both, to read a table
>containing an email address, subject and body, format the mail and then
>send it out.

Well, your requirements are a bit vague, but I'd do something like this:

        while IFS=":" read address subject body
        do
                /usr/lib/sendmail -t << EOF
        To: $address
        Subject: $subject

        $body
        EOF
        done < table

If you need more than a one line body you'll need to parse the table
some other way.

                                        Ross Ridge


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users