smtp.c
/*
** Print multipart/mixed or multipart/related header
** if mixed and embedded images are specified, make
** to use multipart/alternative for the embedded images.
*/
Print multipart/mixed or multipart/related header
if mixed and embedded images are specified, make
to use multipart/alternative for the embedded images.
Print multipart / mixed or multipart / related header if mixed and embedded images are specified make to use multipart / alternative for the embedded images .
int print_content_type_header(const char *boundary)
{
    Sll
        *oneline_attachment_list,
        *attachment_list,
        *embed_image_list;
    (void) snprintf(buf, bufsz,"Mime-version: 1.0\r\n");
    write_to_socket(buf);
    if (*g_content_type!='\0')
    {
      (void) snprintf(buf,sizeof(buf)-1,"Content-type: %s; boundary=\"%s\"\r\n",
              g_content_type,
              boundary);
      write_to_socket(buf);
      return(0);
    }
    oneline_attachment_list = get_oneline_attachment_list();
    attachment_list = get_attachment_list();
    embed_image_list = get_embed_image_attachment_list();
    if (oneline_attachment_list || attachment_list)
    {
        (void) snprintf(buf,sizeof(buf)-1,
                "Content-type: multipart/mixed; boundary=\"%s\"\r\n", boundary);
        write_to_socket(buf);
        return(0);
    }
    if (embed_image_list)
    {
        (void) snprintf(buf,sizeof(buf)-1,
                "Content-type: multipart/related; boundary=\"%s\"\r\n", boundary);
        write_to_socket(buf);
        return(0);
    }
    write_to_socket("\r\n");
    return(0);
}
int print_content_type_header ( const char * boundary ) { Sll * oneline_attachment_list , * attachment_list , * embed_image_list ; ( void ) snprintf ( buf , bufsz , " \r \n " ) ; write_to_socket ( buf ) ; if ( * g_content_type != ' \0 ' ) { ( void ) snprintf ( buf , sizeof ( buf ) - 1 , " \" \" \r \n " , g_content_type , boundary ) ; write_to_socket ( buf ) ; return ( 0 ) ; } oneline_attachment_list = get_oneline_attachment_list ( ) ; attachment_list = get_attachment_list ( ) ; embed_image_list = get_embed_image_attachment_list ( ) ; if ( oneline_attachment_list || attachment_list ) { ( void ) snprintf ( buf , sizeof ( buf ) - 1 , " \" \" \r \n " , boundary ) ; write_to_socket ( buf ) ; return ( 0 ) ; } if ( embed_image_list ) { ( void ) snprintf ( buf , sizeof ( buf ) - 1 , " \" \" \r \n " , boundary ) ; write_to_socket ( buf ) ; return ( 0 ) ; } write_to_socket ( " \r \n " ) ; return ( 0 ) ; }
Print multipart/mixed or multipart/related header
if mixed and embedded images are specified, make
to use multipart/alternative for the embedded images.
Print multipart / mixed or multipart / related header if mixed and embedded images are specified make to use multipart / alternative for the embedded images .