First thing I have to ask...has he been neutered? Malamutes are a VERY dominant breed of dog, and when they are not fixed, aggression is more likely when not properly trained. They need strong "alpha" owners to lead them, and give them boundaries. Don't train with aggression or yelling, that will never work with any dog. He needs to trust you, not fear you (nor you, him). They NEED to be socialized with other pets and humans.
I'm so sorry to hear that your neighbor's dogs attacked him while on a leash with you. Are these dogs running loose, and what breed are they? Are they males that are intact? If there was even one attack on my dog, I'd be having a serious conversation with those neighbors, and make sure they'd be contained in the yard, and it would never happen again.
I don't recommend an electronic collar, I have used them for puppy training, as a reminder in unfamiliar areas not to go too far away from me. They are very inconvenient to use, and the remote cannot fall into anyone's hands that is irresponsible, and may shock the dog as punishment, etc.
Once your neighbors dogs are taken care of, and your dog no longer fears any threats, you can continue to work with him. He looks like a beautiful boy, I had a chocolate colored Alaskan Malamute male many years ago. You must be in charge of the dog, in control, and he must see you as his leader and guardian.
He can never be permitted to bite you, he needs to be corrected and learn that that type of behavior is not acceptable. Have a large rawhide bone around, and when you correct him, give the bone and tell him to chew that. I may have a few suggestions, please tell me more about him first. How much exercise is he getting daily? Is he being socialized at all with other dogs and people? Where does he spend most of the day and night?
Welcome to the forum. I think you can have a very sweet pet with a bit of work on your part, and any other family members. Are there kids or other pets at home? If so, how is he with them? I know, a lot of questions, but they're necessary for consideration in what may help.
"We can judge the heart of a man by his treatment of animals." ~Immanual Kant~