Someone sent anonymous emails from my phone and it’s now getting traced to my IP (phone number)

Can my iPhone be hacked?

Thanks