So you are saying it should look like this?

Yes, what you showed is correct. Note it's generally better to use heredocs instead of a multiline qq, so e.g.

my $email_message = <<"ENDMAIL"; To: $recipient Subject: Adoption Application ... ENDMAIL
My host is telling me i'm not allowed to look at the email logs, I've asked them what I can access and i'm waiting to hear.

You could write out your data to a logfile on your account, in case something with the emails doesn't work out.

I know the code is horrible but i'm learning.

If this were a legacy script, ok, but if this a new script, then you'd be much better off learning something more modern. I've been doing a lot with Mojolicious recently, and I think it's pretty great. See Mojolicious::Guides::Tutorial for getting started. Otherwise, at the very least what this script needs is to Use strict and warnings! See also UP-TO-DATE Comparison of CGI Alternatives.

And with that many variables, it'd be much better to store them in a data structure like a hash. Then you could do things like loop over it so you don't have to repeat the regex a bunch of times. (Also, note you don't seem to be doing anything with the yardtypeother field.)

Also, you should check if the host has Email::Sender::Simple installed, that should be much better and easier to use than shelling out to sendmail.


In reply to Re^3: sendmail working for me but not another by haukex
in thread sendmail working for me but not another by kickingchicken

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.