Disclosed are methods of preparing substituted indolizines represented by the following formula: comprising reacting a substrate represented by the following formula: with either the cyclization reagent of the following formula: or, a reagent prepared by reacting the compound represented the formula below with an alkylating agent: The variables in the above formulas are defined herein.