sed optimization

I have a process using the following series of sed commands that works pretty well.
sed -e 1,1d $file |sed 1i\\"EHLO Broadridge.com" |sed 2i\\"MAIL FROM:${eaddr[0]}"|sed 3i\\"RCPT TO:${eaddr[1]}"|sed 4i\\"DATA"|sed 5s/.FROM/FROM:/|sed 6s/.TO/TO:/|sed 7,7d|sed s/.ENDDATA/./|sed s/.ENDARRAY// >temp/$file

I now need this to run much faster... I'm thinking its pretty slow because I'm calling sed so many times; but I can't figure out how to get this to run in one instance of sed... help.

Thanks
Niten

i think within one sed can do it:

sed -n '2{i\
 EHLO Broadridge.com
 s/.ENDDATA/./
 s/.ENDARRAY//
 p
}
3{i\
 MAIL FROM:${eaddr[0]}
 s/.ENDDATA/./
 s/.ENDARRAY//
 p
}
...
' yourfile