Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to test out forwarding, filters, and spam. I want to see how a spam message will be affected by my current configuration.

I want to send myself a message that will show up as spam in my Gmail address.
How can I do this?

Notice how this is not asking how to send a spam message that won't be caught by the gmail filters... it's asking the exact opposite.

Ideally, the solution shouldn't cause my email address to go on some global black list on gmail's servers. If your method does cause this sort of thing, please mention it so that people trying it out will take care to use a test account they don't actually use.

Please don't offer a solution which doesn't answer the question above and instead focuses on a solution for this specific example. The reason being that my criteria could change tomorrow and I might have some other reason to test spam messages.

Things I have tried which didn't work:

  • Sending an email with no subject and no body
  • Using "viagra" in the subject line
  • Using random symbols in the subject line

Things I don't want to try:

  • Reporting a message as spam on the receiving account. I'm afraid Google might think it's actual spam and because I'm using a gmail address to send the message, I might be in violation of the agreement, or they may report my information (e.g. IP address I used to sign up for gmail) to some other authority.
share|improve this question

Use the Generic Test for Unsolicited Bulk Email (GTUBE). It's a standardized spam signature used precisely for testing spam filters.

Put this in the body of the test email:


and it will force it to be recognized by Gmail as spam.

share|improve this answer
Sounds too easy. Do you have a source for this? – Al E. Dec 5 '12 at 14:38
It's the GTUBE. Standardized spam signature: en.wikipedia.org/wiki/GTUBE – korylprince Mar 28 '13 at 18:08
up vote 8 down vote accepted

What I ended up doing, which worked really well, was creating an email with some text in the body:

This is a test of the email system. This is not a real spam message, but rather one that is trying to purposely get into the spam folder of another account. This is so that I can ensure that my Gmail filters are setup correctly.

... and a subject line such as:

Test Spam Message 1

I always incremented the number at the end of the subject for each message I sent. This way it doesn't look like a duplicate to Gmail and is actually delivered.

Next, on the receiving account, I decided to go ahead and mark the message as spam. I read in the help that it mentions that marking a message as spam is reversible. They even give an example of how a user might accidentally mark a message as spam, then undo it. This is exactly what I am hoping to emulate.

After marking the first message as spam, all the others (which contain the exact same body and only differ in the subject by one letter) are sent to spam as well.

Once I was done with the testing, I marked all the messages as non-spam. Hopefully Gmail treats this as a user accidentally marking a message as spam and doesn't resort to blacklisting the address or doing something worse.

Update: After trying this again, I had to mark a message as spam twice before anything started happening, and then I noticed weird behaviors on the account that was sending the "spam". The account was automatically logged off, and I couldn't log back in for a while. This might be an automated measure Gmail takes when users report other Gmail users as spammers.

share|improve this answer

This site worked perfectly for me (for testing gmail spam filters): http://www.maysoft.com/selfservespam.nsf/dl

share|improve this answer
I was going to add this before I noticed you already had. This worked perfectly for me as well for testing some custom spam filtering software. – Sherwin Flight Dec 21 '13 at 19:26
But is only listed on a few dnsbl – Userpassword May 14 '14 at 12:20

Logically if you repeatedly send emails that gmail interprets as spam then your email account will become a candidate for going on a blacklist. So I would start out with a throwaway test email rather than one you might want to use again.

Secondly the easiest way to simulate spam is to farm the farmers. Why not just put the test email account as a plain link on your homepage - you can then guarantee that spam will be targeting that account within a few hours.

share|improve this answer
Thanks for the suggestion. I'm looking for a way where I can control exactly when a message is sent rather than getting flooded by too many messages, or, on the opposite side of the scale, waiting too long until I get the next spam message. The ideal situation is if I can consistently send myself a spam message. – Senseful Aug 17 '10 at 22:11

This will only help you if you can do a bit of programming:

  • set up an SMTP client (e.g. if you are on Windows, install IIS and SMTP support)
  • write a program in your favorite programming language that will send the email message and have it use your local SMTP server
  • use a random, invalid email for "from"
  • put "viagra" in subject and body for good measure

I would think that would do it.

share|improve this answer

protected by Community Jun 24 '15 at 15:37

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.