The previous method didn't work so I ended up declaring an array and pushed the message into it and now it works.
CGI Code:
my @success;
push @success, "Congratulation, your mail was sent!";
$self->stash ( successmsg => \@success);
HTML Code:
<% if ($successmsg) { %>
<% for my $s (@$successmsg) { %>
<%=$s %>
<% } %>
<% } %>
Hope that helps in the future