Code Monkey home page Code Monkey logo

mailfactory's Introduction

MailFactory
======

mailfactory is tool for generating a mail object that you can use to test your apps email parsing behavior. 

install
=======
script/plugin install git://github.com/thinkbohemian/MailFactory.git


Example
=======

mail = mail_factory(:from_email => from_email , :to_email => to_email , :subject => subject, :body => body)

If you want to simulate receiving an email from "[email protected]", sent to "[email protected]" with a subject of "my cool subject" and a body of "this is only a test" you could create the object like this:

mail_factory(:from_email => "[email protected]" , :to_email => "[email protected]" , :subject => "my cool subject", :body => "this is only a test")

If you don't care about some fields, mail factory will auto generate them for you.

mail = mail_factory


TMail::Mail.parse(mail).to.to_s
=> "[email protected]"

TMail::Mail.parse(mail).from.to_s
=> "[email protected]"

TMail::Mail.parse(mail).subject.to_s
=>"testing testing"

TMail::Mail.parse(mail).body.to_s
=>"This is a test body. Pretty generic really, should make it past most filters\n"

=======

I created this to help test out my rails application http://www.WhySpam.Me its a new spin on sticking it to the man (the one spam-ing you all the time), if you want to fight back against spam, or just want to check out my site i would appreciate the visit. WhySpam is a creative commons licensed open source project, help out at:  http://github.com/thinkbohemian/WhySpam/tree/master


Copyright (c) 2009 [Richard Schneeman || www.thinkbohemian.com ], released under the MIT license

mailfactory's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.