Sending email with blat does not work even with stunnel - email

I've been looking everywhere for this answer and have had no luck! I went to http://www.jeffkastner.com/2010/01/blat-stunnel-and-gmail/ and followed it step by step. Stunnel installed, installed service and started service successfully but blat still does not work after setting it up.
I have a folder on my desktop C:\Users\Nicholas\Desktop\Games which is where the contents of blat is placed, and C:\Users\Nicholas\Desktop\Games\stunnel is where stunnel files are installed. And I also tried this when stunnel was installed to program files and it still did not work. I don't want blat installed to system32 because I have a batch file I'm using it with in C:\Users\Nicholas\Desktop\Games.
Online I try to find syntax for the blat -install but none of them work or at least I dont understand how it works. This is what I believe:
You need to install your profile
You send an email using the profile (ex: blat -p gmailsmtp ...)
And thats it? It doesn't work for me.
I am willing to find an alternative to blat, but if you give an alternative please give a tutorial, not a suggestion.
Here are the install commands for blat I tried: (Which one should be working?)
blat -install smtp.gmail.com
blat -install smtp.gmail.com myemail#gmail.com -u username(does this include #gmail.com?) -pw password – - gmailsmtp
Here are email commands I tried:
blat -p gmailsmtp -to myemail#gmail.com -subject "subject text" -body "Body text" -server 127.0.0.1:1099
and a lot more commands that I can't remember.
Anyway, anyone find where I tripped here?

Yes! I found a vbscript script that finally worked! On this thread, "Email sending not working", Miguel posted the following script
Sub SendGMail()
' Object creation
Set objMsg = CreateObject("CDO.Message")
Set msgConf = CreateObject("CDO.Configuration")
' Server Configuration
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "user#gmail.com"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
msgConf.Fields.Update
' Email
objMsg.To = "user#gmail.com"
objMsg.From = "fromuser#domain.com"
objMsg.Subject = "Test send with Gmail account"
objMsg.HTMLBody = "HTML/Plain text message."
objMsg.Sender = "Mr. Name"
Set objMsg.Configuration = msgConf
' Send
objMsg.Send
' Clear
Set objMsg = nothing
Set msgConf = nothing
End Sub
This script is working, but a lot of people still had problems, looking closer into the script I realized I didn't even recall the SendGMail()! To make this work I simply typed SendGMail() on the next line and BAM! I got an email! Thank you #user4317867 for helping me find my answer.

Related

Exit Telnet Through Batch File

I've been asked to write a script in work that will send an email to our support email if an IP stops allowing us access to telnet on port 23. I've got the gist of what I need, but when the IP doesn't deny access, the script opens telnet and I can't get it to close using a command in the batch file.
This is what I've got so far. Sorry if there is already a question which answers this, I haven't been able to find it.
#ECHO OFF
set IPADDRESS=1.2.3.4
set INTERVAL=5
telnet %IPADDRESS% 23
if errorlevel 1 GOTO LOG
:LOG
ECHO %DATE% %TIME% %IPADDRESS% Could Not Be Reached >> failurelog.txt
GOTO MAIL
:MAIL
blat -install smtpserver
blat failurelog.txt -to email -subject "%IPADDRESS% Is Down"
timeout %INTERVAL%
exit

Ubuntu Command line email sending

I am trying to send an email to myself.
I have tried sudo apt-get install postfix mailutils followed by
mail -s "This is the subject" --append=FROM:myemail#gmail.com
Then i get:
To:
Cc:
...
I enter the info in the To and Cc spaces followed by pressing enter. But, then it just gives me empty space. I click enter and it just keeps giving me new lines. Then I click ctrl^C twice and it kills the email. I just want to send it.
Use Control-d to end it. Please see this Source https://linux.die.net/man/1/mail.
Make sure to add a relay host if you have one if the /etc/postfix/main.cf file

How to send mail from zimbra command line

I am vikas. i am looking a command that can send mail from zimbra mail-store server to external world. but as i checked in zimbra not getting Any program that have role of sending mails. that is why i am relay email through Zimbra MTA server. now i am going to use below command but still getting variable error.
awk 'BEGIN{print "Subject:test mail!\nFrom:Mailadmin <admin#knowledgelinux.com>"}{printf("%s\015\n", $0)}' $message file-name=/test.txt | sendmail -t "mail#knowledgelinux.com"
awk: command not found
The instructions here worked for me:
vim /etc/logwatch/conf/logwatch.conf
Relevant lines to be replaced:
Output = mail
MailTo = root_all#your.domain
MailFrom = Logwatch#your.domain
mailer = "/opt/zimbra/common/sbin/sendmail -t"
Zimbra uses a modified version of sendmail.
The Zimbra MTA uses a modified postfix daemon. You should be able to just use the command mail:
cat *messagefilename* |mail -r *fromaddress* -s *Subject* *recipient-list*
As long as the Zimbra MTA is running on the machine in question this should work.

Executing mail -s "testing" myemail#gmail.com just hangs. Why?

I'm debugging a problem with a script not emailing out.
When i execute the following outside of the script:
mail -s "testing" myemail#gmail.com
It just hangs. The terminal doesn't give me any feedback what it's doing or if it has finished. I can only enter a another command by CTRL + Cing it. Any ideas why? Sometimes it does work if I let it hang long enough (I will get an email about 2 - 4 minutes later).
I'm running CENTOS 5 something. I've just uninstalled sendmail and installed postfix to see if this fixes it and the same thing appears to be happening.
If you enter the above and hit it should take you to a blank line and wait for you to type the actual text of the message. Once you've completed entering the message, you enter a .<enter> (dot or period followed by enter key) as the first character on a line and (depending on the version), it will usually ask you to enter any CC: addresses. Hit again to proceed past that and it should then send the mail.
The above command doesn't actually send anything, the -s sets the subject, but unless you include a file it will simply wait for you to type something. If, on the other hand, you want it to just send something quickly you can have it pull in a file as the content of the message, e.g. mail -s "testing" myemail#gmail.com < some_text_file. This will read some_text_file into the body of the email and send it immediately.

mail command of unix

I am using the mail command of unix in a perl script. I specify the 'to', 'cc', 'subject' and 'body' of the mail. I do not specify the from address. Where is the from address picked from? Pls help
There are portable libraries for handling email as daxim and David W mention, but if you want a quick fix, this works under linux if your mail command uses bsd-mailx (as it does on my machine)...
#!/usr/bin/env perl
$BODY = "Hello self";
$RECIPIENT = "destination\#email.local";
$FROM = "mike\#localhost";
$SUBJECT = "some subject here";
$CMD = qq(echo "$BODY" | mail -a "From: $FROM" -s $SUBJECT $RECIPIENT);
exec($CMD);
If you have more questions about the unix mail command, try man mail from your shell prompt.
The mail command on most system nowadays is Heirloom mailx. It claims compatibility with POSIX, so the information I give here should be good for any well-behaving mail command.
The From address is set by:
either the user#domain as returned by the appropriate POSIX system calls (see shell commands whoami and domainname -f for a different way to access them)
or set by the from environment variable
or set by the -r command line option (going to be deprecated?)
Obligatory Clippy: Hi! I see you are trying to send mail from Perl. Did you mean to use Email::Sender/Email::Simple instead?
Don't use the mail command linecommand! Use Net::SMTP.
The mail command may not even be configured on a particular system, and it won't work on Windows. Meanwhile, Net::SMTP is a standard Perl module that should be available on all systems.
Never used it before? Read the documentation and try it out. That's how you learn.