shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] Mail com anexo


From: Sérgio Roberto
Subject: Re: [shell-script] Mail com anexo
Date: Fri, 08 Jul 2005 15:07:07 -0300
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Tenta isso: (Retirado do Viva o linux)

#!/bin/bash
# Set variables
NAME_SMTP="localhost"
IP_SMTP=`ping -c 1 $NAME_SMTP | head -n 1 | cut -d"(" -f2 | cut -d")" -f1`

# It verifies if the correct parameters
if [ "$1" = "" ]
then
    echo "Send email via telnet - $NAME_SMTP: $IP_SMTP"
    echo "Usage:   $0 [-ft] <from> <to> <subject> <file or text>"
    echo "Options: -f text be in file"
    echo "         -t single text"
    echo
    echo "This script based in one help of the (Fernando Hallberg) list"
    echo "address@hidden."
    exit 1
fi

if [ "$1" = "-f" ]
then
    MENSAGE=`cat $5`
else
    if [ "$1" = "-t" ]
    then
        MENSAGE=$5
    else
        echo "Invalid option."
        exit 1
    fi
fi

# Send mensage
echo -e "helo $NAME_SMTP\r\nmail from: <$2>\r\nrcpt to: <$3>\r\ndata\r\nSubject: $4\r\n\r\n$MENSAGE\r\n.\r\n" > /dev/tcp/$IP_SMTP/25



Victor Leonardo wrote:

Olá pessoal!

Alguém sabe como enviar mensagens pelo mail com arquivos anexos?


Obrigado!

Victor




---------------------------------------------------------------------
Esta lista não admite a abordagem de outras liguagens de programação, como 
perl, C etc. Quem insistir em não seguir esta regra será moderado sem prévio 
aviso.
---------------------------------------------------------------------
Sair da lista: address@hidden
---------------------------------------------------------------------
Esta lista é moderada de acordo com o previsto em 
http://www.listas-discussao.cjb.net
---------------------------------------------------------------------

Links do Yahoo! Grupos









__________ Informação do NOD32 1.1152 (20050623) __________

Esta mensagem foi verificada pelo NOD32 Sistema Antivírus
http://www.nod32.com.br







reply via email to

[Prev in Thread] Current Thread [Next in Thread]