William J. Miller, 59, an official of the U.S. Postal Service since January 1973, and a former assistant postmaster general, died Sunday at Shady Grove Adventist Hospital in Rockville after a heart attack. He was a resident of Darnestown.

Mr. Miller joined the Postal Service as assistant postmaster general for preferential mail. For the past year, he had been the senior research scientist at Postal Service headquarters in Washington.

Other positions he had held with the service include director of electronic management systems and director of the office of advanced mails systems development. Before becoming senior research scientist, he was executive director of the Postal Service Research Laboratory.

Mr. Miller was born in Pittsburg, served in the Army in Europe during World War II and graduated from Carnegie Mellon University. He also earned a master's degree at Rensseelaer Polytechnic Institute and later studied at the Sorbonne in Paris.

He worked for the General Electric Company for 25 years before joining the Postal Service. His assignments with GE took him to New York, Pennsylvania, Lynchburg, Va., and Europe.

Mr. Miller was a member fo the American Society of Metals. He also was a member of the parish of St. Raphael's Catholic Church in Rockville.

Survivors include his wife, Catherine C., and a son, William Joseph, both of Darnestown, and six sisters and one brother, all of Pittsburgh.

The family suggests that expressions of smypathy be in the form of contributions to the building fund of St. Joseph's Church, Scranton, Pa.