Personalized Emails

polarion
2011-11-22
2013-01-23
  • polarion

    polarion - 2011-11-22

    Hi,

    I want to send to posfix message body, recipients emails and recipients names.
    So server can create from message body and recipients names list next messages:
    "
    Dear recipient_name,
    >>message body
    "

    and send it to corresponded recipient email.

    Is it possible to do such matching on server side?

    Thank you!

     
  • Simon Hobson

    Simon Hobson - 2011-11-22

    Neither Postfix nor Postfix Admin will do this.

    What you would need to do is knock up a simple script that generates the emails and submits them - there may well already be something that already does this. Pretty well any language is capable of doing this, and submitting emails can be done either from within the language, or by calling something lime "mail".

    An outline in Bash :

    recipients="recipient file.txt"
    body="body text.txt"
    subject="Your message subject"
    while read name email
    do
      ( echo "Dear ${name}"
        cat "${body}") | mail -s "${subject}" "${email}"
    done < "${recipients}"
    

    obviously this does no error checking, and I've not checked it myself, but it should give you an idea to work from.

     
  • polarion

    polarion - 2011-11-22

    Thank you very much!

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks