Sending Text Messages (SMS) With ColdFusion And CFMail - coldfusion

I'm building a web application that needs to send notifications by SMS. As ColdFusion itself provides an SMS Service, can I use the same for sending SMS without using any 3rd party SMS Gateway Service like Clickatell?
I have found some information at Ben Nadel's website but it is not working,
Sending Text Messages (SMS) With ColdFusion And CFMail
I have tried the following code,
<cfmail to="9567102323#ideacellular.net" from="9567102323" subject="New Message" type="text">
<cfmailpart type="text/plain">Hello huan, this is a test message</cfmailpart>
</cfmail>

As guessed by Miguel in the comments, your code will not give the desired result because the from attribute of your cfmail tag is not a valid email address. Your ColdFusion code will execute without error but the mail will not be sent. The mail file will appear in the Undelivr folder of a path resembling this: yourlocalsystem\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\cfusion\Mail.
For the code in your question, add "#ideacellular.net" to the from attribute of your cfmail tag. From here, I'm a little uncertain. If that mail goes to the Undelivr folder it might have something to do with your mail server only being able to send mail from certain domains. I have vague recollections of stuff like that happening to me.

You can't send SMS direct from ColdFusion, does not have this capability, just like ColdFusion does not have a built-in mail server. cfmail tag makes it easy to communicate with a mail server, but it does not send emails itself.
Regarding SMS, ColdFusion makes it easy to work with SMS gateways, look at CF docs for "SMS Event Gateway" and sendGatewayMessage().

Related

Mail sending fails without errors

What do I have:
Laravel app (5.5.45)
Mailgun
I send mail like this:
//App\Listeners namespace
Mail::to($event->user)->send(new Report($event->report));
There are no errors in app logs. And there are no incoming mail in the Mailgun dashboard. And, obviously, no mail on my mailbox (spam too).
I'm using debug bar, and when email sending is triggered, my mail appears in the debug bar.
What have I tried:
composer update
Delete Mailgun domain and create a new one
php artisan config:cache
Use Mailgun sandbox domain
Serve my Laravel app via HTTPS and HTTP
Nothing helped.
Question: how can I debug mail senging in other ways? I know about Mailgun webhooks, but I can set up a webhook for my local app.
P. S. When I'm sending mail using curl, everything is ok. So, I can say that my api keys are ok.
Edit 1:
dd(Mail::to(...));
returns null.
Edit 2: everything is ok when sending via SMTP.
From Laravel 5.3V Notify system feature is introduced try this
https://laravel.com/docs/5.4/notifications

Can I restrict cfmail to only send mail from a given domain using cf admin

We have had issues with our server being used to send spam via cfmail to our remote SMTP server. I cannot see where it is occurring, but the emails are sent from a domain that is not one on our server.
Is there a way using ColdFusion administrator to specify that only emails showing as from someone#mydomain.com are sent to the SMTP host via the spool?
Thanks in advance,
Paul
It sounds to me like the <cfmail> side of things here is a red herring and you have got an open relay on your mail server. You seriously need to disable that immediately! If your SMTP server has to relay email for your CFML app then make sure it's not configured to relay everything, instead just for the IP address of the CF server, or for the credentials the CF server uses to connect to it.
If you don't know how to configure the relaying settings for your SMTP server, raise another question on serverfault.com asking how. Provide the exact details of your SMTP server, as well as the requirement to still allow relaying for the CF server.

Coldfusion CFMAIL and sendgrid

I have 2 clients on the same server that I host, that both send email through sendgrid.com (both have their own accounts).
I was looking at reports on sendgrid and noticed that categories from "client 1" were showing up in a report for "client 2".
I spent extensive time on the phone with sendgrid and they are telling me that a handful of emails 65 from a batch of 3000 for "client 1" show as being sent through "client 2"'s authenticated user.
In my scripting, I use coldfusion cfmail and I specify the SMTP address, username and password for that client into the tag.
A possible theory takes into account the "Maintain connection to mail server" check box under mail in the administrator.
"Select this check box to keep the connection to a mail server open for reuse after delivering a message (recommended)."
If both clients send email at the same time (very much possible) would the coldfusion mail spooling engine separate them out based on server/username and password or send them all through to the mail server that is currently open?
If I uncheck the maintain connection to mail server checkbox... what is the downside on resources? my clients send newsletters and transactional emails all day, maybe about 10k each client.
I don't know what version of ColdFusion you are running but in ColdFusion 9 a new feature was added that allows you to specify the SMTP server settings in your Application.cfc file. Assuming that you have separate Application.cfc files for your 2 sites then perhaps this will work for you.
Here is a reference to the new feature in ColdFusion 9
Here is the text from that referenced page.
Problem
How can I use the different SMTP Server Settings for Applications hosted in ColdFusion server for sending Email.
Solution
By using the new ColdFusion 9 “smtpServersettings" feature in Application.cfc file, we can specify different SMTP server settings for Applications.
Detailed explanation
ColdFusion 9 added a new attribute called "smtpServersettings" to the Application.cfc file. We can specify the SMTP server setting details to "smtpServersettings" attribute of THIS scope in Application.cfc which takes three values and they are server, username and password as a structure.
<cfcomponent displayname="CF9ApplicationVariables" output="false">
<cfset this.name = "CF9ApplicationVariables" />
<cfset this.smtpserversettings = {
server="mailServerAddress",
username="userEamilID",
password="userPassword"
} />
</cfcomponent>
Now the CFMail tag will use the server details for sending mails as mentioned above in "smtpServersetting" in Application.cfc and it won't use the server values specified in the ColdFusion 9 Administrator. If "smtpServersetting" attribute is not used then CFMail will behave as normally.
I ended up modifying the DNS settings in my servers, adding a cname that pointed to the smtp address, smtp.sendgrid.net. I then updated my code to use the new server names, and this seems to be separating the connections.

Sending SMTP mail using POCO C++ through http proxy

I don't have too much experience programming in C++, but I need to build a basic application for sending state emails from a computer using windows or linux, and I've found that POCO C++ suppoorts both platforms, but I have a proxy http provider behind to filter unauthorized connections, so, how could I do it?.
You can't send SMTP e-mail through a HTTP proxy.
But you can make a HTTP connection to a website you control. And you can write a web-to-email script and put that on your website. E.g. your script can take a status message as a POST parameter and then send it out as e-mail.
Spammers often try to hack web-to-email scripts to send spam, so please make sure your script has a hard-coded destination e-mail address. That way the spammer can only send mail to you, not everyone else on the Internet. Whatever you do, don't pass the destination e-mail address as a parameter.
regarding web to email scripts - make sure you strip newlines from anything that ends up in email headers! (to prevent spammers from injecting headers)

C++ - Mail Sender

I would like to create a mail sender on C++ (not Mail Client for eg. GMail). In this mailer I want to be able to change the headers also.
I have already downloaded and installed the POCO libraries, that might help (I found it on a similar anwser).
For example, what I would like is a command like below:
e-mailsend(to,headers,subject,message);
// Or something like:
email.send(to,headers,subject,message);
However, If possible, I would like to use a C++ Mail function not a system function (like mail-utils in unix).
If you need any more explanation please comment...
In your comments you asked for an option without an SMTP server.
SMTP requires an SMTP Server. The choice is that could send emails directly (e.g. to joe at yahoo.com on port 25) or to a SMTP server that will relay the message.
Ideally, you will want your own SMTP server locally (so your application is simpler and your SMTP server sends the messages in the background, handles retries, bounces and connection errors) and use a reputable SMTP service or an existing email account.
If you want to send spam, I'd strongly advise against it.
If you want to send a small number of messages that will be opened by people expecting those messages, use a normal account (Yahoo, GMail, Google Apps, etc) and if you find your application not responsive enough, install Postfix, Sendmail or whatever local SMTP server you like.
If you want to send a large volume of emails and you are sure those message won't get you targeted as a spammer, use an SMTP service, like SendGrid (note: they also have a web API that you might find easier to use than SMTP).
Depending on which of the above you need, I'm sure answering your original question with a recommendation for SMTP C++ clients (like POCO) with become simpler.