Menu

format of the From line

2003-02-05
2003-02-06
  • Ken Weinert

    Ken Weinert - 2003-02-05

    I'm a bit confused about what form the FROMaddress is supposed to be in. I've tried a couple of alternatives and it appears as if you (I don't think it's the SMTP server) are rewriting them and they come out a bit odd.

    I'll post examples if this is something that you've not seen before.

     
    • John Wiggins

      John Wiggins - 2003-02-05

      Just use the address the mail is going to be from
      i.e. If you are person1@foobar.com
      Then you send the "person1@foobar.com" string in the FROMaddress variable of the constructor.

      whatever you pass in the constructor for this address should not be getting rewritten by the code. The only way to change it after construction of a mailer object is to use the
      setsender(const std::string& newsender) function.

       
    • Ken Weinert

      Ken Weinert - 2003-02-05

      \&quot;Chuck\&quot; <charles.berghoefer@ihs.com>

      That is the content of the string I put in for the FROMaddress, this is how it comes out in the email:

      Chuck <charles.berghoefer@ihs.com> (Chuck <charles.berghoefer>)

      (all one line, of course)

      This is not my address, I had the FROM and TO backwards in the constructor :), but something is still doing things a bit oddly.

      I've tried with and without the double quotes around the name.

      I'm talking directly with the company SMTP server, and it is possible that the transformation is happening there, but it doesn't seem to be for any other program.

      I'll take a further look at the source.

       
    • John Wiggins

      John Wiggins - 2003-02-06

      oops sorry my code does not allow for a real name (at present) in an address.
      this is the simple line I use to address a mail
      commandline = "MAIL FROM:<" + fromAddress + ">\r\n";
      this will end up being:
      MAIL FROM:<"Chuck" <charles.berghoefer@ihs.com>>
      which of course is totally wrong.
      Just remove the \&quot;Chuck\&quot;

      I will add the ability to do this to the code!

       
    • John Wiggins

      John Wiggins - 2003-02-06

      Sorry Ken you also need to remove the < & > from each end of the address i.e.

      "charles.berghoefer@ihs.com"

      thats all you need
      good luck

       
    • Ken Weinert

      Ken Weinert - 2003-02-06

      No problem - I was just trying to make a nicely formatted from line - especially as this is from a "virtual" account - ie a running process. The name is the important part in this case . I'm using my email address so if they reply for some reason it will go to a real person.

      I see what you were trying to do, but perhaps you should just depend on the programmer putting in a correctly formatted address.

      The problem is, is that I sit here and look at it there are a couple of ways to be able to put in the info. Maybe it should just be parsed to see if it looks like a good address.

      At any rate I appreciate your quick response and willingness to enhance the code.

      Now if I could only solve that SunOS problem . . .

       

Log in to post a comment.