Error Sending Mail Using FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'
Dear All,
I am calling the function module 'SO_NEW_DOCUMENT_ATT_SEND_API1' inside the program to send mail to ( i.e [email protected]) either yahoo or gmail or etc.
After calling this function module i am getting error message ''Document could not be sent to any recipient'' i.e sy-subrc = 2.
But i am using same function module with SAPUSER ID as a receiver list its working fine.
Please let me know why this problem comming to send email to extenal.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc_chng
put_in_outbox = 'X'
COMMIT_WORK = 'X'
TABLES
packing_list = g_t_packing
object_header = g_t_objheader
contents_txt = g_t_objtxt
receivers = g_t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
CASE sy-subrc.
WHEN 0.
WRITE 'The document was sent'.
WHEN 1.
WRITE: / 'No authorization for sending to the specified number',
'of recipients'.
WHEN 2.
WRITE: / 'Document could not be sent to any recipient'.
WHEN 4.
WRITE: / 'No send authorization'.
WHEN OTHERS.
WRITE: / 'Error occurred while sending'.
ENDCASE.
TABLES
packing_list = g_t_packing
object_header = g_t_objheader
contents_txt = g_t_objtxt
receivers = g_t_receivers
where is hte body of the content ?
i think this is missing .
<b>contents_bin</b> = objbin
just check the same
regards,
vijay
Similar Messages
-
Error while sending mail using script task in ssis 2008
Hi,
i am trying to send mail using ssis 2008 script task.for my requirement i am not able to use send mail task.
code i have used is
declared read only variables system::packagename
Dim PACKAGE As String
PACKAGE = Dts.Variables("System::PackageName").Value.ToString()
Dim myHtmlMessage As MailMessage
Dim mySmtpClient As SmtpClient
myHtmlMessage = New MailMessage("[email protected]", "[email protected]", "PACKAGE STATUS", PACKAGE + "WAS FAILED")
mySmtpClient = New SmtpClient("smtp.gmail.com")
mySmtpClient.Credentials = New NetworkCredential("[email protected]", "mypassword")
mySmtpClient.EnableSsl = True
mySmtpClient.Port = 587
mySmtpClient.Send(myHtmlMessage)
error i am getting is
Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
Authentication Required. Learn more at
at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
can any one tell me where i am going wrongalso getting error as follows
Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
Authentication Required. Learn more at
at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript() -
SMICM error while sending mail using SMTP server
Hi All,
We are not able send mails using SMTP server.
We have made every settings necessary in SCOT, SO16 , SMTP service is activated, default domain is maintained etc
Only things which seems to be wrong is in SMICM trace file.
[Thr 13] *** ERROR => NiBufIConnect: non-buffered connect pending after 5000ms (hdl 29;10.26.24.44:1090) [nibuf.cpp 4608]
[Thr 13] *** WARNING => Connection request from (0/1/0) to host: 10.26.24.44, service: 1090 failed (NIECONN_REFUSED)
[icxxconn_mt.c 2321]
This error is getting repeated in it.
BUt I am not sure why it it trying to hit 10.26.24.44, as we dont have any server by this ip. The ip is only not resolvable from the server.
1 more thing, at OS level, following parameter is maintained in profile :
icm/server_port_1 = PROT=SMTP,PORT=25000,TIMEOUT=180
But in SCOT, under SMTP node PORT is given as 25.
Kindly let me know what going wrong here?
Thanksalso getting error as follows
Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
Authentication Required. Learn more at
at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript() -
I am new to Mac and i managed to install and configure all the services. Now my issue is when i sending mail using the local server to internal, mails are not receiving. Mail queue showing Connection refused error. Please help me
Thanks
GIRITry this -> http://support.apple.com/kb/TA38632?viewlocale=en_US
-
Problems to SEND MAIL using WWV_FLOW_MAIL.SEND - APEX_MAIL
I tried send mail using the code below
DECLARE
l_body CLOB:= EMPTY_CLOB;
l_body_html CLOB:= EMPTY_CLOB;
BEGIN
wwv_flow_api.set_security_group_id;
l_body :='<html>
+<head>+
+<style type="text/css">+
+body{font-family: Arial, Helvetica, sans-serif;+
+font-size:10pt;+
+margin:30px;+
+background-color:#ffffff;}+
+span.sig{font-style:italic;+
font-weight:bold;
color:#811919;}
+</style>+
+</head>+
+<body>+
+</html>';+
l_body_html := '<html>
+<head>+
+<style type="text/css">+
+body{font-family: Arial, Helvetica, sans-serif;+
+font-size:10pt;+
+margin:30px;+
+background-color:#ffffff;}+
+span.sig{font-style:italic;+
font-weight:bold;
color:#811919;}
+</style>+
+</head>+
+<body>+
+</html>';+
wwv_flow_mail.send('[email protected]','[email protected]',nvl(l_body,'Texto com erro'),nvl(l_body_html,'erro2'),'K','[email protected]',
+'[email protected]','[email protected]');+
wwv_flow_mail.push_queue;
END;
+/+
This code return the message:
Mail To From Subject CC BCC Created On Created By Error Created
CHECK$01 [email protected] [email protected] K [email protected] [email protected] 08/23/2010 03:05:00 PM SYS
ORA-06502: PL/SQL: erro: erro de conversão de caractere em número numérico ou de valor
Follow my mail settings
SMTP Host Address : POP.SLE.TERRA.COM.BR
SMTP Host Port 110
Administration Email Address [email protected]
Notification Email Address [email protected]
what´s wrong ?I would try sending just basic text first, then move on to getting your other pieces dynamics. The very last step to me would be the email body.
Here is an example of a basic text email I use:
declare
e_id NUMBER;
c_id NUMBER;
emp_nm VARCHAR2(100);
clrk_id NUMBER;
e_clrk VARCHAR2(47);
e_org NUMBER;
e_sender VARCHAR2(50);
e_recip_lst VARCHAR2(255);
e_cc VARCHAR2(100);
e_bcc VARCHAR2(100);
e_subj VARCHAR2(50);
e_msg_ln1 VARCHAR2(100);
e_msg_ln2 VARCHAR2(100);
e_msg_ln3 VARCHAR2(100);
e_msg_ln4 VARCHAR2(100);
e_msg_ln5 VARCHAR2(100);
e_msg VARCHAR2(1000);
CRLF CHAR(2) := CHR(13) || CHR(11);
tmp_flag NUMBER;
begin
if :P2_INJURY_FLAG = 1 then
-- find out if it has changed first so we don't keep sending emails
select injury_flag, VEH_LOC
into tmp_flag, e_org
from APPS.tc
where tc_id = :P2_TC_ID;
if :P2_injury_flag <> tmp_flag then
begin
select FN_GET_USER(nvl(v('APP_USER'),user))
into clrk_id
from dual;
select ADMIN_USERNAME
into e_clrk
from APPS.APEX_ACCESS_CONTROL
where ID = clrk_id;
exception
when others then null; -- in case we cannot find the user
end;
e_id := :P2_EMP_ID;
c_id := :P2_TC_ID;
select EMP_FNAME ||' '|| EMP_MNAME ||' '|| EMP_LNAME into emp_nm
from APPS.EMPLOYEES
where EMP_ID = e_id; --
select RECIPIENTS, CC, BCC
into e_recip_lst, e_cc, e_bcc
from APPS.SAFETY_NOTIFICATIONS
where ORG_ID = e_org; --
e_sender := '[email protected]';
e_subj := 'Loss Reported';
e_msg_ln1 := 'Employee: ' || emp_nm || ' (' || e_id || ')'
|| CRLF;
e_msg_ln2 := 'Was reported as sustaining a loss' || CRLF;
e_msg_ln3 := 'by ' || e_clrk ||CRLF;
e_msg_ln4 := CRLF;
e_msg_ln5 := 'Sent ' || to_char(sysdate,'MONTH DD,YYYY HH:MI AM');
e_msg := e_msg_ln1 || e_msg_ln2 || e_msg_ln3 || e_msg_ln4 || e_msg_ln5 || CRLF || e_recip_lst;
utl_mail.send(
sender => e_sender,
recipients => e_recip_lst,
cc => e_cc,
bcc => e_bcc,
subject => e_subj,
message => e_msg);
end if;
end if;
end; -
How can send mails using hotmail/rediffmail domain name?
I have used the below code to send a mail using javamail API?Even when I am sending my application does not have notified any of error/exceptions,But the message is not reached to I have given receipient's address in the to field.
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class Sendmail1 extends HttpServlet {
private String smtpHost;
// Initialize the servlet with the hostname of the SMTP server
// we'll be using the send the messages
public void init(ServletConfig config)
throws ServletException {
super.init(config);
smtpHost = config.getInitParameter("smtpHost");
//smtpHost = "sbm5501";
smtpHost = "www.rediffmail.com";
public void doGet(HttpServletRequest request,HttpServletResponse response)
throws ServletException, java.io.IOException {
String from = request.getParameter("from");
String to "[email protected]";
String cc = "[email protected]";
String bcc ="[email protected]";
String smtp ="www.rediffmail.com";
String subject = "hai";
String text = "Hai how r u";
PrintWriter writer = response.getWriter();
if (subject == null)
subject = "Null";
if (text == null)
text = "No message";
String status;
try {
// Create the JavaMail session
java.util.Properties properties = System.getProperties();
if (smtp == null)
smtp = "www.rediffmail.com";
properties.put("mail.smtp.host", smtp);
Session session = Session.getInstance(properties, null);
//to connect
//Transport transport =session.getTransport("smtp");
//transport.connect(smtpHost,user,password);
// Construct the message
MimeMessage message = new MimeMessage(session);
// Set the from address
Address fromAddress = new InternetAddress(from);
message.setFrom(fromAddress);
// Parse and set the recipient addresses
Address[] toAddresses = InternetAddress.parse(to);
message.setRecipients(Message.RecipientType.TO,toAddresses);
Address[] ccAddresses = InternetAddress.parse(cc);
message.setRecipients(Message.RecipientType.CC,ccAddresses);
Address[] bccAddresses = InternetAddress.parse(to);
message.setRecipients(Message.RecipientType.BCC,bccAddresses);
// Set the subject and text
message.setSubject(subject);
message.setText(text);
Transport.send(message);
//status = "<h1>Congratulations,</h1><h2>Your message was sent.</h2>";
} catch (AddressException e)
status = "There was an error parsing the addresses. " + e;
} catch (SendFailedException e)
status = "<h1>Sorry,</h1><h2>There was an error sending the message.</h2>" + e;
} catch (MessagingException e)
status = "There was an unexpected error. " + e;
// Output a status message
response.setContentType("text/html");
writer.println("<title>sendForm</title><body bgcolor= ><b><h3><font color=green><CENTER>CALIBERINFO.COM</CENTER></h3>Your message was sent to recepient(s).<br><font color=red>"+"\n"+to);
writer.println("<br><br><a href=e:/mail/javamail/mail.html>back to compose</a>");
writer.close();
Please any one help me out from this probs.
Awaiting for yours reply,
or give me a reply to: [email protected]
Regards,
@maheshkumar.kHi,
how can send mails using hotmail/rediffmail domain name?In your java application,you specified www.rediffmail.com as your
smtp server.But that is the address of that website.Try will a smtp
server instead.For a list of free smtp servers,please visit http://www.thebestfree.net/free/freesmtp.htm
Hope this helps.
Good Luck.
Gayam.Srinivasa Reddy
Developer Technical Support
Sun Microsystems
http://www.sun.com/developers/support/ -
Send mail using Internal Mail server doesn't work
I can't send mail using my companies mail server, which requires authentication and port 587 to send. We have a valid, non self-signed SSL certificate so that is not the issue. I can send mail using Bell's mail server but that violates our regulatory compliance obligations.
The server using POP3 and one must login to get mail as well as send. Unfortunately there is no otehr error message than the: error sending "mail subject". No further details are provided and when we check the mail servers logs its clear the Pre isn't even attempting to connect to the mail server. So the request to send mail isn't even being sent out. That could be an issue with the Pre or with Bell but Bell support will only troubleshoot to the point of fidning out if you can send using their mail server. We can so their support stops at that point.
I still have v1.3.1 of the WebOS as v1.3.5 doesn't seem to be out for the Bell Pre's yet. But from what I've read v1.3.5 is even worse at handling mail not better. However, there may be a solution out there to this beyond sending the Pre's back (I doubt we can) as Balckberry's and iPhone's don't have this issue.
Any advice is greatly appreciated.
Post relates to: Pre p100eww (Bell)Further update on this problem. It does send if I use TLS instead of SSL so that must mean that the Palm Pre doesn't use SSLv3 or higher. As TLS is a viable security setting option to maintain compliance I can use that. But still Plam should seriously consider upgrading tis SSL versioning.
-
Fixing :there was an error sending mail"
I am using Adobe Reader 9 and Acrobat 8 Pro on a Lenovo, Windows 7, 64bit machine. When I right-click pdf files from my directories, and select "send", the file attaches itself to a new e-mail (from Outlook) and I can send - no issues. However, if I am viewing an open pdf and I select the e-mail or send icon from the toolbar, I get an error message (first box just says "error", then second box says "there was an error sending mail". I have Googled this issue and, in turn checked my Windows settings for Outlook, etc. I see no issues. I have run Adobe updates - still doesn't work. Any ideas?
Thanks, WaylandWhat I'm trying to say, that when I update my App there an error appears
-
Can not send mail using wifi at a motel .I can receive mail fine
can not send mail using wifi at a motel .I can receive mail fine
Hi there tamarafromdarien,
You may find the troubleshooting steps for iCloud Mail in the article below helpful.
iCloud: Troubleshooting iCloud Mail
If you can't send mail in OS X Mail
If you receive this alert or a similar alert when sending a message from your iCloud email address in OS X Mail:
“This message could not be delivered and will remain in your Outbox until it can be delivered. The reason for the failure is: An error occurred while delivering this message via the smtp server: server name.”
In OS X Mail, choose Preferences from the Mail menu.
Click Accounts in the Preferences window.
Select your iCloud account from the list of accounts.
Click the Account Information tab.
Choose your iCloud account from the Outgoing Mail Server (SMTP) pop-up menu. Example: “Derrick Parker (iCloud)”.
Note: The Outgoing Mail Server (SMTP) menu also includes an Edit SMTP Server List command. If you choose this command, be aware that the iCloud SMTP server won't be among the servers that can be edited. This is normal.
If you're attaching a large file
Message attachments can't exceed the maximum size allowed by your email service provider or the recipient's email service provider. The maximum size varies by service provider. Try compressing the filebefore sending it, or send your message without the attachment to verify that there are no issues with sending.
-Griff W. -
Hi ,
I am getting the below error when scheduling a report which is larger in size in excel format.
write error. [Error sending mail message to SMTP server. Return code: [].]: [CrystalEnterprise.Smtp]
The same error does not come up when sending the same report in XLS format using outlook.
Can some one confirm if this error is because of the size of the report as I see a different error in XIR2 incase the size the exceeds the email server limit.
~NeethiHi,
this could be
Maybe you have different limits for service smtp account (which the BO Server should use) and User smtp accounts.
Thats why you can sent it via outlook and not from the BO Server.
Regards
-Seb. -
Hi,
The below error messgage i am getting while scheduling report in CMC. My report getting refreshed successfully but while posting refreshed file(Excel) it is not posting and throwing below error.
Error Message:
write error. [CrystalEnterprise.Smtp]: [Error sending mail message to SMTP server. Return code: [].]
please provide some help on this.
Thanks
VivekHi Vivek
Mails to the destinations are delievered by SMTP server. Size of the file in the mail depends on the SMTP server.
For example, If SMTP server does not permit file size more than 2MB then that file won't be delievered.
For testing purpose copy the instance generated in Filestore to your local drive and send this instance using your mail client to
desired destination.
You can try sending large size file from your mail client to test SMTP server capacity of sending large size file.
Thanks,
Hrishikesh Parasnis -
Hi. I have started using my iPhone 4S as a WiFi hotspot for my MBP when on the road. Mail collects from all my accounts ok but I cant send any mails from my MBP thru the Hotspot connection. I dont get any error message, just the spinning icon next to the sent mailbox and no info in the activity window. Any ideas welcome. thanks
Are you sending mail using a Broadband provider account?
For instance, Virgin Media Mail can only be send through the Virgin Media Sever when you are actually connected to your Virgin Media line (at home)
An attempt to send mail using the outgoiong server smtp.virgin.com will be blocked if it isn't coming down one of their own lines.
To cure it, you'll need to add a different smtp server to our mail account that can be used while youo're out an about. Normally this would be the smtp server that your phone company gives you i.e smtp.orange.co.uk or whatever. -
Interesting db mail issue. If i click send test mail from sql mgmt studio, it works fine, but when i execute a SP to send a mail, it fails. One thing I noticed is that the "LastModified" column in the mail log shows the domain account when a test
mail was sent from mgmt studio, but show "sa" when the SP was used to send mail.
This is from SQL 2012, did not see this in sql 2008, looks like 2008 always used the service account. any ideas ?
Get this error:
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2013-04-30T16:36:52). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.7.1 Client does not
Thanks.
RangaHi Ranga,
I also use SQL Server 2012. I send a test email through SQL Server Management and the last modified By “sa”.
If you used stored procedure to send a test email. Please use the command below:
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'Adventure Works Administrator',
@recipients = '[email protected]',
@body = 'The stored procedure finished successfully.',
@subject = 'Automated Success Message' ;
I can both send test email through SQL Server Management Studio and SP. Make sure you have the right profile. Since you could send test mail via SQL Server Management Studio, please try again to send it via SP.
Thanks.
If you have any feedback on our support, please click
here.
Maggie Luo
TechNet Community Support -
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.Net.Mail;
public partial class _Default : System.Web.UI.Page
protected void SendEmail(object sender, EventArgs e)
string to = txtTo.Text;
string from = txtEmail.Text;
string subject = txtSubject.Text;
string body = txtBody.Text;
using (MailMessage mm = new MailMessage("gmail account","my personal account to send message on this email"))
mm.Subject = "txtSubject.Text";
mm.Body = "Hello";
mm.IsBodyHtml = false;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
NetworkCredential NetworkCred = new NetworkCredential("gmail account", "password");
smtp.UseDefaultCredentials = true;
smtp.Credentials = NetworkCred;
smtp.Port = 587;
smtp.Send(mm);
ClientScript.RegisterStartupScript(GetType(), "alert", "alert('Email sent.');", true);
}What's the error you're getting?
This code snippet could help you.
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add("[email protected]");
message.Subject = "This is the Subject line";
message.From = new System.Net.Mail.MailAddress("[email protected]");
message.Body = "This is the message body";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("yoursmtphost");
smtp.Send(message);
How do I send mail using C#
Happy Coding! -
Cannot Send Mail using AIM account.
I can receive mail fine but when I try to send mail I get the following message:
Cannot send mail using the server smtp.aim.com:EmilyLozano.
Use the pop-up menu below to try a different outgoing mail server. All messages will use this server until you quit Mail or change your network settings.
Message from: Emily Lozano <[email protected]>
I left for a trip a few days ago, came back and now for no apparent reason cannot send mail as I always have. I have reconfigured the port to 587 and that did not help. Any suggestions? (I can send and receive fine via the web, but I really hate it.)I'm glad you got it figured out. So many times people on this forum sit around waiting for help when they could have retraced their steps, like you did, to figure out the source of the problem.
Maybe you are looking for
-
Dear Apple Support Community! I installed Mavericks OS X on my iMac immediately after it was released. I was soon starting to experience trouble with logging in to Mail and App Store. After contacting Apple Support and trying various tips and tricks
-
No network adapter or drivers seen in windows 7 after Boot Camp 5.0.
Mac Book Pro (newest). I Did a boot camp install of windows 7 home premium. Allowed 76 Gigs for that partition. Thought that would be enough. Did just fine. Got all done and I cannot access the internet wifi or eithernet in Windows, when I trouble s
-
Php select using column Field names ?
Hello, I need some advice using this select usually I do this $query = "SELECT * FROM table WHERE title LIKE 'body'"; it works, is fast and no problems. But now I've a big table [id, ..., ...] and need to select just the row starting with body, so I
-
Why does my calendar keep clearing.
How can I keep my calendar on my ipad and laptop and desktop all synced together without it deleting something off of one of them. I add stuff to which ever one I have with me at the time including my iphone.
-
FF7, had to reboot due to another program. After reboot when I open FF it shows minimized. I can left click on it and maximize, but I cannot then re-size it.