I want to integrate SendGrid smtp email to send mail from my Classic asp application. I have no idea about how to integrate third party mail server.
I only used gmail server to send mail from application.
If I register on sendgrid with mail id xyz#gmail.com then which credential i need to use for userid and password. Do i need to use sendgrid credential for below example:-
enter image description here
Which credential i need to use in yellow circle.
link for above example Example link
I read docs provided on sendgrid official site, but idea is not cleared how to use it.
Please help on this..
thanks
sagar
If you have an account with SendGrid then presumably you have a username and password to log in to it - you just need to use these as the values in the yellow box.
Their example is actually pretty standard cdo.message code. If you have got it to work with gmail then you should be able to modify your existing gmail code. SendGrid also appears to use port 465 so all you would need to change is the smtp server address and the username and password.
See this page
http://webcheatsheet.com/asp/sending_email_asp.php
Late to the party.. That link is not longer working.
This is the solution on how to send emails with SendGrid in Classic ASP.
Set oMail = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.sendgrid.net"
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
iConf.Fields.item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = {your API key}
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = {your password}
iConf.Fields.Update
Set oMail.Configuration = iConf
oMail.To = {to}
oMail.From = {from}
oMail.Subject = {subject}
oMail.HTMLBody = {htmlmessage}
oMail.TextBody = {textmessage}
oMail.Send
Set iConf = Nothing
Set Flds = Nothing
set omail=nothing
Related
im trying to configurate my STMP in grafana so i can receive alerts from grafana when certain specification are filled, although i gives me an error (displayed in the picture bellow).
Im currently using grafana localhost and i dont know if thats affetc with something, im going to leave the code from "defaults.ini" (STMP part).
I must add that the email in the error is not the same as the email i used in the code..
enabled = true
host = smtp.office365.com:587
user = "Myemail"
password = "Mypass"
skip_verify = true
from_address = "Myemail"
from_name = Grafana
Error from grafana Picture (Click here to see the pic)
I've set up a Woocommerce webshop and would like to change the recipient for the order invoice.
The website uses WooCommerce V3.6.5 with the Flatsome Theme.
I tried to change the admin email address in Wordpress settings but that didn't work. I still receive the invoice at the old email address.
I tried to look into the function.php but that only shows the following:
* #package flatsome
*/
require get_template_directory() . '/inc/init.php';
Does anyone know how to change the order invoice recipient? In the WooCommerce -> Settings -> Email tab I can only change the email formats and "From" email address.
I would go for this solution using $recipient variable, please have a try.
function change_email_recipient( $recipient ) {
global $woocommerce;
$recipient = 'email#email.com';
return $recipient;
}
add_filter( 'woocommerce_email_recipient_new_order', 'change_email_recipient', 10, 2 );
I am creating a windows phone 8 app. I have created a PDF document and now I want to send this PDF to an email address. But I do not know how to proceed with this.
Please Help me.
Thanks,
(First search search search then ask)
see this one MSDN:
To send normal email,you should add:
using Microsoft.Phone.Tasks;
to your code, and then for personalizing and going to the mail app add this:
EmailComposeTask emailComposeTask = new EmailComposeTask();
emailComposeTask.Subject = "message subject";
emailComposeTask.Body = "message body";
emailComposeTask.To = "recipient#example.com";
emailComposeTask.Cc = "cc#example.com";
emailComposeTask.Bcc = "bcc#example.com";
emailComposeTask.Show();
for sending attachemnts see these links once
end-email-with-attachments-without-using-emailcomposetask-with-mailmessage
how-to-send-automated-emails-with-attachments-from-windows-phone-apps
hi i am connecting to facebook using the following code it work fine for my two account one is gmail and another one is yahoo but it is only working on that accounts not log in on the other accounts of the gmail,yahoo,hotmail i check every acccount that i have every time onautherror come why ? what i am doing wrong is my code is wrong can any one tell me plz
Jid jidUser = new Jid(txtBoxUserName.Text);
xmppCon.ConnectServer = jidUser.Server;
xmppCon.Username = jidUser.User;
xmppCon.Server = "chat.facebook.com";
xmppCon.Port = 5222;
xmppCon.Password = txtBoxPassword.Text;
xmppCon.AutoResolveConnectServer = true;
xmppCon.Open();
Facebook doesn't allow the username/password XMPP authentication anymore.
You can only login using the X_FACEBOOK_PLATFORM SASL mechanism.
See:
http://developers.facebook.com/blog/post/2011/09/09/platform-updates--operation-developer-love/
So for Facebook use X_FACEBOOK_PLATFORM SASL auth in agsXMPP and it will work fine.
Im planning to use google oauth IMAP to sign up for my website.
Im using zend framework for the same.
http://code.google.com/p/google-mail-xoauth-tools/wiki/PhpSampleCode
Also im suing 3 legged approach to sign up
When i go through the sample threelegged.php.
I find that i t has email address inbox and he keeps it in a session and goes to access the gmail account and once he returns back he retireves the email id from the session
$email_address = $_SESSION['email_address'];
Line No.121
$config = new Zend_Oauth_Config();
$config->setOptions($options);
$config->setToken($accessToken);
$config->setRequestMethod('GET');
$url = 'https://mail.google.com/mail/b/' .
$email_address .
'/imap/';
My requirement is i do not want to have email address to be kept in session instead i want the given the gmail address to be retrieved in
$email address.
How can i do that ?
Is any function supporting it in Zend framework?
http://sites.google.com/site/oauthgoog/Home/emaildisplayscope
You will need to include the authorization url with your other urls you are asking permission to get data from:
https://www.googleapis.com/auth/userinfo.email
Then when you actually get the authorized token you can do it like this:
// Get access token from session after authorization process is complete.
$accessToken = unserialize($_SESSION['ACCESS_TOKEN']);
// Retrieve email address using Access Token
$erequest = $accessToken->getHttpClient($options);
$erequest->setUri('https://www.googleapis.com/userinfo/email');
$erequest->setMethod(Zend_Http_Client::GET);
$ereturn = $erequest->request();
parse_str($ereturn->getBody(), $earray);
$email_address = $earray['email'];
// Retrieve mail using Access Token
$config = new Zend_Oauth_Config();
$config->setOptions($options);
$config->setToken($accessToken);
$config->setRequestMethod('GET');
$url = 'https://mail.google.com/mail/b/' .
$email_address .
'/imap/';
This is after authenticating a token for accessing the data. Then the email address can be used for your mail request or anything else that requires the email address.