Club Builder - Foros de discusión Club Builder
Foro de C++Builder en español
 
 FAQFAQ   BuscarBuscar   MiembrosMiembros   Grupos de UsuariosGrupos de Usuarios   RegistrarseRegistrarse 
 PerfilPerfil   Entra para ver tus mensajes privadosEntra para ver tus mensajes privados   EntrarEntrar 

NO LOGRO ENVIAR ARCHVO ADJUNTON EL COMPONENTE IdSMTP

 
Publicar nuevo tema   Responder al tema    Foros de discusión -> Consultas
Ver tema anterior :: Ver tema siguiente  
Autor Mensaje
Mensaje    Asunto: NO LOGRO ENVIAR ARCHVO ADJUNTON EL COMPONENTE IdSMTP Responder citando

IdMessage1->Subject = "Servicio de Bienestar";
IdMessage1->Body->Text = mmss.c_str();
IdMessage1->From->Address = "CORREO@gmail.com";


IdMessage1->Recipients->Add();
IdMessage1->Recipients->Items[0]->Address = Correo->Text;

IdSMTP1->Username = "CORREO@gmail.com";
IdSMTP1->Password = "XXXXXXXX";
IdSMTP1->Host = "smtp.gmail.com";

IdSSLIOHandlerSocketOpenSSL1->PassThrough =true;
IdSMTP1->IOHandler = IdSSLIOHandlerSocketOpenSSL1;

//ME MUESTRA UN ERROR
IdSMTP1->PostMessage->Attachments->Add("C:\ejemplo.pdf");

IdSMTP1->Connect();
IdSMTP1->SendCmd("STARTTLS");
IdSSLIOHandlerSocketOpenSSL1->PassThrough = false;
IdSMTP1->Authenticate();
IdSMTP1->Send(IdMessage1);


IdSMTP1->Disconnect();
ShowMessage("Mensaje enviado con Exito.");
Volver arriba
Ver perfil de usuario Enviar mensaje privado
Mensaje    Asunto: Responder citando

No es por nada, pero ¿que error te da?
Código:
//ME MUESTRA UN ERROR
IdSMTP1->PostMessage->Attachments->Add("C:\ejemplo.pdf");


Creo que deberías poner
Código:
..Add("C:\\ejemplo.pdf");
pero sin saber el tipo de error, todo son especulaciones

Saludos
Volver arriba
Ver perfil de usuario Enviar mensaje privado
Mensaje    Asunto: Responder citando

Me dice que PostMessage no es miembro de IdSMTP1.

DESEO ENVIAR CORREOS CON ARCHIVOS ADJUNTOS
Volver arriba
Ver perfil de usuario Enviar mensaje privado
Mensaje    Asunto: Responder citando

\\Archivo Adjunto - correo
String cF="C:\\Users\\fuentevilla\\Desktop\\MAGGI14\\2997-33-LP14\\bases_catering_2014.docx";
TIdAttachmentFile *attachment = new TIdAttachmentFile(IdMessage1->MessageParts, cF);
attachment->FileName = ExtractFileName(cF);
attachment->ContentType = GetMIMETypeFromFile(cF.c_str());
attachment->ContentID = "<ExtractFileName>ParentPart = nri";
if (TextStartsWith(attachment->ContentType, "image/"))
attachment->ContentDisposition = "inline";


AL RECIBIR EL CORREO ME MUESTRA ESTO;

--JypQD3V=_E1rYKHqgdS7w93OmlRi9IYmgN
Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document;
name="bases_catering_2014.docx"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="bases_catering_2014.docx"
Content-ID: <ExtractFileName>ParentPart = nri

UEsDBBQABgAIAAAAIQBnbmUX5gEAANMIAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAAC
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

ALGÚN COMENTARIO???
Volver arriba
Ver perfil de usuario Enviar mensaje privado
Mensaje    Asunto: Responder citando

Creo que te falta añadir código

Código:

new TIdAttachmentFile(IdMessage1->MessageParts,ruta + "\\" + Nombre); //incluir el archivo a enviar
IdMessage1->ContentType = "multipart/mixed"; //especificar que tipo de contenido lleva el mensaje
Volver arriba
Ver perfil de usuario Enviar mensaje privado Dirección AIM
Mensaje    Asunto: Solucionado Responder citando

TADOQuery *CorreoInstitucional=new TADOQuery(this);
CorreoInstitucional->Connection=Form1->AdoRRHH;
CorreoInstitucional->SQL->Add("Select * from Bienestar_Representantes");
CorreoInstitucional->SQL->Add(" where cargo='Presidente'");

CorreoInstitucional->Open();


String mmss="Sr(a). "+Nombres->Text+" "+Apellidos->Text+".\nEnvío Cartola de Beneficios Médicos.\n\n";
mmss=mmss+"\nAtte.\nSr(a). "+CorreoInstitucional->FieldByName("nombres")->AsString+" "+CorreoInstitucional->FieldByName("apellidos")->AsString;
mmss=mmss+"\nPresidente\nComité de Bienestar";

CorreoInstitucional->SQL->Clear();
CorreoInstitucional->SQL->Add("Select * from Bienestar_Correo");
CorreoInstitucional->Open();

if(!CorreoInstitucional->Eof)
{
String Mail = CorreoInstitucional->FieldByName("correo")->AsString;
String Usuario = CorreoInstitucional->FieldByName("username")->AsString;
String Clave = CorreoInstitucional->FieldByName("password")->AsString;
String Host = CorreoInstitucional->FieldByName("host")->AsString;


IdMessage1->Clear();


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


TOpenDialog *Cf= new TOpenDialog(this);
Cf->FileName="C:\\Users\\jfuentevilla\\Desktop\\SimulacionCreditoBienestar.pdf";

TIdAttachmentFile *attachment;
attachment = new TIdAttachmentFile(IdMessage1->MessageParts, Cf->FileName.c_str());
attachment->ContentType = L"application/*.pdf;";


IdMessage1->Subject = "Servicio de Bienestar Municipal";
IdMessage1->Body->Text = mmss.c_str();
IdMessage1->Body->Text = mmss.c_str();



/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



IdMessage1->Recipients->Add();
IdMessage1->Recipients->Items[0]->Address = Correo->Text;


IdSMTP1->Username = Usuario.c_str();
IdSMTP1->Password = Clave.c_str();
IdSMTP1->Host = Host.c_str();

IdSSLIOHandlerSocketOpenSSL1->PassThrough =true;
IdSMTP1->IOHandler = IdSSLIOHandlerSocketOpenSSL1;


IdSMTP1->Connect();
IdSMTP1->SendCmd("STARTTLS");
IdSSLIOHandlerSocketOpenSSL1->PassThrough = false;
IdSMTP1->Authenticate();
IdSMTP1->Send(IdMessage1);


IdSMTP1->Disconnect();
ShowMessage("Mensaje enviado con Exito.");
Volver arriba
Ver perfil de usuario Enviar mensaje privado
Mostrar mensajes de anteriores:   
Cambiar a:  
No puedes publicar temas nuevos en este foro
No puedes responder a temas en este foro
No puedes editar tus mensajes en este foro
No puedes borrar tus mensajes en este foro
No puedes votar en las encuestas de este foro


Hosting WordPress Indedmedia desde 3,99 €
© 2002–2026 Club Builder · Funciona con phpBB.