Eingabefeld-Text zu E-mail senden
-
Hallo erstmal bin neu hier,
kenne mich ein wenig mit C++ aus
ich benutze Visual C++ zum erstellen eines programmes
so soweit so gut habe eine nette oberfläche erstellt
so nun zu meiner Frage:
in mein Dialog-Programm möchte ich gerne ein textfeld
einbauen wo man etwas hereinschreiben kann so
und wenn man dann auf enter drückt oder auf einen button soll es zu meiner
email adresse geschikt werden.
wäre sehr nett wenn ihr dem neuankömmling helfen würdet
mfg
Killnum :p
-
Woran hapert's denn? Kannst du das Textfeld schon auslesen? Oder stockt's beim mailen?
edit: Und hallo, willkommen!

-
Badestrand schrieb:
Woran hapert's denn? Kannst du das Textfeld schon auslesen? Oder stockt's beim mailen?
edit: Und hallo, willkommen!

also das ist so ich hab ja schon ne oberfläche
und brauche den code für die textbox.
die text box soll beinhalten das wenn man dort was eingibt dann auf enter oder ein button klickt diese eingabe an meine email adresse gesendet wird^^ und danke^^
-
Dann schieß mal los, was du genau brauchst, "Code für die Textbox" kann alles mögliche sein.
-
Standard C++ kennt keine Textbox oder eine E-Mail. Verschieben. Zu deinem problem, poste den code den du zurzeit hast und dann können dir leute auch helfen, keiner hier schreibt 'ne app für dich.
-
ein simples eingabefeld so wie bei meinem programm:
http://s5.tinypic.com/2myt1rm.jpg
und dazu brauch ich jetzt den code der die box dazu macht , wofür ich sie brauch
unzwar schik ich zb diese exe (mein programm) an meinen kumpel dieser gibt da irgendwas ein drückt enter und ich bekomm es zu meiner email adressemfg Killnum

Edit: ok hier
// emailboxDlg.cpp : implementation file // #include "stdafx.h" #include "emailbox.h" #include "emailboxDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CEmailboxDlg dialog CEmailboxDlg::CEmailboxDlg(CWnd* pParent /*=NULL*/) : CDialog(CEmailboxDlg::IDD, pParent) { //{{AFX_DATA_INIT(CEmailboxDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CEmailboxDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CEmailboxDlg) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CEmailboxDlg, CDialog) //{{AFX_MSG_MAP(CEmailboxDlg) ON_WM_PAINT() ON_WM_QUERYDRAGICON() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CEmailboxDlg message handlers BOOL CEmailboxDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here return TRUE; // return TRUE unless you set the focus to a control } // If you add a minimize button to your dialog, you will need the code below // to draw the icon. For MFC applications using the document/view model, // this is automatically done for you by the framework. void CEmailboxDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Center icon in client rectangle int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon dc.DrawIcon(x, y, m_hIcon); } else { CDialog::OnPaint(); } } // The system calls this to obtain the cursor to display while the user drags // the minimized window. HCURSOR CEmailboxDlg::OnQueryDragIcon() { return (HCURSOR) m_hIcon; }
-
-
Ein bisschen mehr mühe musst du dir schon geben. Das ganze von dem Wizard erstellen zu lassen war keine mühe.
- Du regelest es auf dem harten weg und erstellst eine verbindung zu dem SMTP Server. Falls verbunden, dann einfach in der reihenfolge versenden:
HELO addr.com
MAIL FROM mail@deinemail.com
RCPT TO empfaenger@deinemail.com
DATA message
QUIT- Du benutzt ein Framework das alles für dich regelt.
-
http://www.patshaping.de/hilfen_ta/pop3_smtp.htm
#include <iostream> #include "jwsmtp/jwsmtp.h" int main(int argc, char* argv[]) { jwsmtp::mailer m("empfängeremail", // z.B name@yahoo.com "deineemail", // z.B blabal@yahoo.com "subject", // titel der mail "msg", // nachricht der mail "smtp.mail.yahoo.de", // smtp server jwsmtp::mailer::SMTP_PORT, false); // default port 25 m.username("deineid"); m.password("deinpw"); m.send(); // shick mail std ::cout << m.response() << "\n"; return 0; }für smtp server nachgucken.
http://www.patshaping.de/hilfen_ta/pop3_smtp.htm
bb
-
danke für eure schnelle hilf

ich probiere es gleich aus mit dem servermfg killnum
da steht ja msg also die nachricht der mail
diese soll aber sein was der jenige ins eingabefeld eingibt^^
syr das ich euch mit fragen durchlöchere
-
Killnum schrieb:
danke für eure schnelle hilf

ich probiere es gleich aus mit dem servermfg killnum
da steht ja msg also die nachricht der mail
diese soll aber sein was der jenige ins eingabefeld eingibt^^
syr das ich euch mit fragen durchlöchere
Dann kopiere den text aus der Editbox in einen buffer.
WinAPI: http://msdn.microsoft.com/en-us/library/ms633520(VS.85).aspx
MFC: http://msdn.microsoft.com/de-de/library/db50wx7h(VS.80).aspxVielleicht solltest du ein Buch und paar Tutorials durchlesen die sich mit MFC/WinAPI beschäftigen.