The invention relates to an automatic gluing machine with high gluing quality, and relates to the field of carton production equipment. The automatic gluing machine comprises a machine frame, a feeding mechanism arranged on the machine frame and used for feeding paperboards, a conveying mechanism arranged on the machine frame and used for conveying the paperboards, a gluing mechanism arranged on the machine frame and used for gluing the paperboards on the conveying mechanism, a creasing mechanism arranged on the machine frame and used for creasing the paperboards on the conveying mechanism, anedge closing mechanism arranged on the machine frame and used for closing edges of the paperboards on the conveying mechanism, a folding mechanism arranged on the machine frame and used for folding the paperboards on the conveying mechanism, and a discharging mechanism for discharging the folded paperboards on the conveying mechanism, wherein gluing, creasing, edge closing and closing are performed in sequence. According to the automatic gluing machine, the feeding mechanism is used for feeding the paperboards, the conveying mechanism is used for conveying the paperboards, meanwhile, the gluing mechanism, the creasing mechanism, the edge closing mechanism and the folding mechanism can be used for gluing, creasing-folding, edge closing and folding the paperboards in sequence, the discharging mechanism is used for discharging the folded paperboards, and automatic processing of cartons is completed, so that the working efficiency is improved.