The Independent Electoral Commission (IEC) says the offence is punishable by a fine or imprisonment of up to a year.
The organisation said exuberant expatriate voters around the world had already posted pictures of their marked ballot papers on social media.
South Africa goes to polls on May 7 in the fifth democratic elections after the fall of apartheid in 1994.
While the IEC said it was committed to monitoring the regulation, it admitted that it would be difficult to remove cameras or mobile phones from every voter before entering the voting booth.
Social media networking is popular in South Africa, with a latest study in March showing that Johannesburg has largest number of active Twitter users in the continent.