Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Mail::Sender problem

by fuzzysteve (Beadle)
on Dec 10, 2001 at 23:01 UTC ( [id://130747]=perlquestion: print w/replies, xml ) Need Help??

fuzzysteve has asked for the wisdom of the Perl Monks concerning the following question:

recently , I've been getting a lot of returned email due to bare line feeds in my messages. (damn messagelabs)
I've been using mail sender to send out the messages, using a MailMsg call to set up the maiul and send it.
Now, as far as I know, that should just shove the entire message through a regex to convert \n to \r\n, but from the fact the messages are bouncing , it seems not to be doing this.
Any thoughs, suggestions? (no, its not spam, its for a subscriber service)

Replies are listed 'Best First'.
Re: Mail::Sender problem
by Fastolfe (Vicar) on Dec 11, 2001 at 00:39 UTC
    How are you formatting your message? Are you sending one block of "multi-line" text directly to the 'Send' method? Maybe you just need to split your string into an array of lines (minus newlines) and pass the resulting string to the SendLine method, which will correctly add the proper newline sequence to each line. See the documentation for Mail::Sender for details.

    An alternative is the SendEx method, which will go through your string and convert your bad newline sequences to proper SMTP newlines. Again, see the documentation. It's pretty clear on this topic.

      The code is in my scratchpad $message is a multiline string

        Since you're using the MailMsg method, you have to fix your newlines beforehand.

        $message =~ s{\n}{\012\010}g;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://130747]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2024-04-23 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found