If you have received a SPAM email from your domain name, it can be disconcerting. But it does not necessarily mean you (or the server) have been hacked. Most often, it is another reason altogether. Here is why.
There are two methods of sending email, both of which spammers use:
1. Sending Email Through Your Email Account
Just like you do, if a spammer gains access to the username/password of your email account, they can log in and use your email server to send emails.
2. Sending Email From Their Web Server
This is how most spam is sent. Any server can send emails, and the code can make the reply address say anything. A few lines of code could send an email from email@example.com.
Most SPAM is sent using #2 above. So a quick line of code and they can send an email that looks like it was sent from your domain but had nothing to do with your domain.
WHY WOULD SPAMMERS SEND EMAILS FROM MY DOMAIN?
The main reason is to bypass spam filters. You might also easier trust an email sent from your domain. So when a spammer has your email on a list (e.g. firstname.lastname@example.org), they write code to send an email "from" another account @webinstinct.com. This helps the spam email make it past a spam filter and seem more familiar to you, the recipient.
IS THERE A WAY TO TELL WHERE THE EMAIL CAME FROM?
There sure is. Every email contains a header, which your email program hides from view. This header contains all sorts of information about where this email came from and how it was sent. It is often straightforward to confirm that the reply address with your domain did not originate from your server.