anchor.diff:      {H,Msg} = retr(?POPSERVER, Session#session.user,
   		   Session#session.passwd, MailNr),
   
  -    ContentType = 
  -	if 
  -	    H#mhead.content_type == undefined -> undefined;
  -	    true -> element(1,H#mhead.content_type)
  -	end,
  +    Formated = format_message(H, Msg),
   
       (dynamic_headers() ++
        [{ehtml,
  
positive.code:     RCc = string:tokens(Cc,","),
      RBcc = string:tokens(Bcc,","),
      Recipients = RTo ++ RCc ++ RBcc,
      Date = yaws:date_and_time_to_string(yaws:date_and_time()),
      Headers =
  	(mail_header("To: ", To) ++
  	 mail_header("From: ", Session#session.user++"@"++?MAILDOMAIN) ++
  	 mail_header("Cc: ", Cc) ++
  	 mail_header("Bcc: ", Bcc) ++
  	 mail_header("Subject: ", Subject)),
      Message = io_lib:format("~sDate: ~s\r\n\r\n~s\r\n.\r\n",
  			    [Headers, Date, Msg]),
      case smtp_send(?SMTPSERVER, Session, Recipients, Message) of
  
negative.code: 
  parse_header_value(Header) ->
      [Key|Options] = string:tokens(Header, ";"),
      Opts = [parse_key_value(O) || O <- Options],
      {Key,Opts}.
  
  
  parse_key_value(O) ->
      parse_key_value(O, []).
  
  parse_key_value([], Acc) ->
      {lists:reverse(Acc), []};
  parse_key_value([$=|Rest], Acc) ->
      Value = unquote(string:strip(Rest)),
      Key = string:strip(lists:reverse(Acc)),
      {Key, Value};
  parse_key_value([C|Cs], Acc) ->
      parse_key_value(Cs, [C|Acc]).
  
  
  lowercase(Str) ->
      [lowercase_ch(S) || S <- Str].
  
  
  lowercase_ch(C) when C>=$A, C=<$Z -> C + 32;
  lowercase_ch(C) -> C.
  
  add_header("content-transfer-encoding", Value, H) ->
      H#mhead{transfer_encoding = lowercase(Value)};
  add_header("content-type", Value, H) ->
      H#mhead{content_type = parse_header_value(Value)};
  add_header("from", Value, H) ->    H#mhead{from = Value};
  