You can get infected from opening an email, but only under specific conditions

Opening an email itself — reading the text or viewing an image — will not infect your device with malware. The act of reading does not execute code. However, opening an attachment or clicking a link inside an email can absolutely introduce a virus or other malicious software to your computer or phone. The distinction matters because it changes what you actually need to do to stay safe.

Most email services, including Gmail, Outlook, and Yahoo Mail, scan attachments for known malware before they reach your inbox. But that scanning is not foolproof. New malware variants appear constantly, and some threats slip through. Links in emails are harder for email services to police — they can point to legitimate-looking websites that actually steal your login credentials or read malware when you visit.

The real risk is not the email itself, but what you do with what is inside it.

Key Takeaways

  • Reading email text or viewing images carries no infection risk; malware requires you to open an attachment or click a link.
  • Email attachments like .exe, .zip, .scr, and Microsoft Office files with macros enabled are the most common infection vectors.
  • Phishing emails that impersonate banks, payment services, or your employer often contain links designed to steal passwords rather than install malware.
  • If you do not recognize the sender or were not expecting the attachment, do not open it — delete it instead.
  • Keeping your operating system, browser, and antivirus software current closes many of the pathways that malware uses to take hold.

Which email attachments actually carry risk

Executable files pose the highest risk. These include .exe files (Windows programs), .scr files (screensavers), .msi files (installers), and .bat or .cmd files (batch scripts). If you read and open any of these, you are running code written by the sender. If that code is malicious, your device is now infected. Most email services block these outright, but some still slip through, especially if they are compressed inside a .zip or .rar file.

Microsoft Office files — .docx, .xlsx, .pptx — can also carry malware through a feature called macros. A macro is a small program embedded in the document. When you open the file and enable macros (which Office sometimes prompts you to do), that code runs. Legitimate documents use macros for automation; malicious ones use them to read and install malware. This is why you see warnings in Office when you open a file from an untrusted source.

PDF files are generally safer, but not risk-free. Older versions of Adobe Reader had vulnerabilities that malware could exploit. Keeping your PDF reader updated closes those gaps. Image files (.jpg, .png, .gif) are extremely unlikely to carry malware on their own, though they can be used in phishing emails to make a scam look more convincing.

How phishing emails trick you into giving up passwords

Many malicious emails do not try to install malware at all. Instead, they use phishing — a social engineering tactic designed to steal your login credentials. A phishing email might look like it came from your bank, PayPal, Amazon, or your employer. It tells you that your account has been compromised, that you need to verify your identity, or that you have a package waiting. The email includes a link that looks legitimate but actually points to a fake website controlled by the attacker.

When you click the link and enter your username and password on that fake site, the attacker now has your real credentials. They can log into your actual account, change your password, and lock you out. If you use the same password across multiple services, they can access those accounts too. This is why phishing is so dangerous — it does not require you to open an attachment or run any code. It just requires you to click and type.

The email itself contains no virus. The danger is in what you do after you read it.

Red flags that signal a risky email

You do not recognize the sender. If someone you have never heard from sends you an attachment or a link, that is a reason to be cautious. Legitimate companies rarely email you out of the blue asking you to click something or read something.

The sender's email address looks slightly off. Attackers often use addresses that mimic real companies — for example, "paypa1.com" instead of "paypal.com", or "amaz0n-security@gmail.com" instead of an actual Amazon domain. Hover over the sender's name (do not click) to see the full email address before you open anything.

The email creates urgency or fear. "Your account will be closed in 24 hours." "Unusual activity detected." "Click here to confirm your identity." These are classic phishing tactics. Real companies do not typically pressure you to act when ready through email.

The attachment or link was not expected. If you did not request a file and were not told to expect one, do not open it. If you are unsure, contact the sender through a phone number or website you know is legitimate — not through a reply to the email.

What to do if you opened a suspicious attachment

If you opened an attachment from an unknown sender, do not panic. The fact that you opened it does not automatically mean you are infected. What matters is what type of file it was and what your device did with it.

If it was a Word document or Excel file and you did not enable macros when prompted, you are almost certainly fine. If it was an image, PDF, or text file, you are almost certainly fine. If it was an executable file (.exe, .scr, .msi) or a .zip containing one of those, you should assume your device may be compromised.

In that case, run a full antivirus scan. Windows Defender (built into Windows) and Malwarebytes (free version available) are both effective. Disconnect from the internet first if you are worried, run the scan, and let it quarantine or delete anything it finds. If you use a Mac, Malwarebytes is also available. If you use an iPhone or Android phone, the risk is much lower — these devices are harder to infect through email attachments, though phishing links still work.

How to reduce your email risk without being paranoid

Keep your operating system updated. Windows, macOS, iOS, and Android all release security patches regularly. These patches close vulnerabilities that malware exploits. Turn on automatic updates so you do not have to remember.

Keep your browser and plugins updated. Browsers like Chrome, Firefox, Safari, and Edge receive security updates frequently. If you use Adobe Reader, Java, or other plugins, update those too. Outdated software is one of the easiest ways malware gets in.

Use antivirus or anti-malware software. Windows Defender is built in and adequate for most people. If you want additional protection, Malwarebytes (free version) runs alongside Defender without conflict. On Mac, built-in protections are strong, but Malwarebytes is still an option. Do not install multiple full antivirus suites — they conflict with each other and slow your device down.

Enable two-factor authentication on accounts that matter — email, banking, social media, payment services. If an attacker steals your password through a phishing email, two-factor authentication means they still cannot log in without a code sent to your phone or generated by an authenticator app.

When in doubt, delete. If an email looks suspicious and you were not expecting it, delete it. If you think it might be legitimate, contact the sender or the company directly using a phone number or website you know is real — not by replying to the email.

The difference between viruses, malware, and ransomware

These terms are often used interchangeably, but they mean different things. A virus is a piece of code that replicates itself by attaching to other programs. A malware is a broad category that includes viruses, worms, trojans, spyware, and other malicious software. A ransomware is a specific type of malware that encrypts your files and demands payment to unlock them.

When people say "I got a virus from an email," they usually mean they got some kind of malware. The distinction does not change what you should do — keep your software updated, use antivirus tools, and do not open attachments from people you do not know. But understanding the category helps you understand what the malware actually does if you do get infected.

Frequently Asked Questions

Can I get infected just by previewing an email in the list without opening it?

No. Previewing an email — seeing the first few lines in your inbox or in a preview pane — does not execute any code or read any attachments. You are safe until you actually open the full email and interact with its contents.

What if I clicked a link in a phishing email but did not enter my password?

You are probably fine. Clicking a link does not infect you. If the link took you to a fake login page and you did not type anything, nothing was stolen. If you are worried, you can change your password anyway, but there is no when ready danger.

Is it safe to open emails on my phone?

Yes, with the same caveats as a computer. Do not open attachments from unknown senders, do not click suspicious links, and do not enable macros in Office files. iPhones and Android phones are harder to infect through email than computers, but phishing still works on phones.

Do I need to buy antivirus software, or is the free version enough?

Free versions are usually enough. Windows Defender (built in) and Malwarebytes (free version) together cover most threats. Paid antivirus software offers more features and faster support, but for typical home use, free tools work well.

What should I do if my email account was hacked?

Change your password when ready from a different device. Enable two-factor authentication if you have not already. Check your recovery email and phone number to make sure the attacker did not change them. Review your account activity and connected apps to see if anything looks wrong. If the account is tied to banking or payment services, contact those companies to let them know.