From the statute 2 U.S.C. § 441e:
It shall be unlawful for—
(1) a foreign national, directly or indirectly, to make—
(A) a contribution or donation of money or other thing of value, or to make an express or implied promise to make a contribution or donation, in connection with a Federal, State, or local election;
(B) a contribution or donation to a committee of a political party; or
(C) an expenditure, independent expenditure, or disbursement for an electioneering communication (within the meaning of section 434 (f)(3) of this title); or
(2) a person to solicit, accept, or receive a contribution or donation described in subparagraph (A) or (B) of paragraph (1) from a foreign national.
Violating 2 U.S.C. § 441e is punishable by a fine and (in the case of clause 2) possible disqualification of the candidate. The law was upheld by the U.S. Supreme Court (9 to 0) in 2011 in Bluman v. Federal Election Commission in 2011
Guess which presumed U.S. presidential candidate did some quiet, not-very-well-hidden fundraising in Israel on his recent foreign tour-de-disaster?